From c7984d0743d1127a51679176218d001982d9cccc Mon Sep 17 00:00:00 2001 From: Seednode Date: Sun, 10 Sep 2023 21:28:27 -0500 Subject: [PATCH] Only remove file from cache after file has been removed from filesystem when --russian is passed --- cmd/root.go | 2 +- cmd/web.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 08878e4..d9826db 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,7 +17,7 @@ var ( ) const ( - Version string = "0.63.0" + Version string = "0.63.1" ) var ( diff --git a/cmd/web.go b/cmd/web.go index 90a44d5..d1bd57d 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -841,10 +841,6 @@ func serveStaticFile(paths []string, stats *ServeStats, index *Index) httprouter fileSize := humanReadableSize(len(buf)) if russian { - if cache { - index.Remove(filePath) - } - err = os.Remove(filePath) if err != nil { fmt.Println(err) @@ -853,6 +849,10 @@ func serveStaticFile(paths []string, stats *ServeStats, index *Index) httprouter return } + + if cache { + index.Remove(filePath) + } } if verbose {