]> Cypherpunks.ru repositories - gocheese.git/commitdiff
Fix mtimeless touch logic v3.1.0
authorSergey Matveev <stargrave@stargrave.org>
Mon, 27 Sep 2021 12:54:43 +0000 (15:54 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 27 Sep 2021 12:57:48 +0000 (15:57 +0300)
main.go
refresh.go

diff --git a/main.go b/main.go
index 417c2c1675c2fc5177bcd4b17de289e7dc6f5163..83bde1b64f43ed8cfc7cc5c2a34849e45e6b19fc 100644 (file)
--- a/main.go
+++ b/main.go
@@ -44,7 +44,7 @@ import (
 )
 
 const (
-       Version   = "3.0.0"
+       Version   = "3.1.0"
        UserAgent = "GoCheese/" + Version
 )
 
index 55c30e085e1437f904d58798695d771638aa4f24..59c8ceb9f5dd7c2b6288e27eb1d1cc0c9f6574e9 100644 (file)
@@ -551,8 +551,8 @@ func refreshDir(
                }
                path = path + "." + hashAlgo
                stat, err := os.Stat(path)
-               if err == nil &&
-                       (mtimeExists && stat.ModTime().Truncate(time.Second).Equal(mtime)) {
+               if err == nil && (!mtimeExists ||
+                       (mtimeExists && stat.ModTime().Truncate(time.Second).Equal(mtime))) {
                        continue
                }
                if err != nil && !os.IsNotExist(err) {