Last active
August 29, 2015 14:26
-
-
Save etix/3a0e13be9a5b7f6a53ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/scan.go b/scan.go | |
index a21f075..69395c0 100644 | |
--- a/scan.go | |
+++ b/scan.go | |
@@ -10,6 +10,7 @@ import ( | |
"os" | |
"path/filepath" | |
"strconv" | |
+ "strings" | |
"time" | |
) | |
@@ -238,11 +239,18 @@ func (s *scan) walkSource(path string, f os.FileInfo, err error) error { | |
sha256 := properties[3] | |
md5 := properties[4] | |
+ if strings.Contains(path, "skin.back-row-3.2.7.zip") { | |
+ log.Warning("modTime from fileInfo: %s", f.ModTime()) | |
+ log.Warning("modTime from redis: %s", properties[1]) | |
+ log.Warning("modTime parsed: %s", modTime) | |
+ } | |
+ | |
rehash := (GetConfig().Hashes.SHA1 && len(sha1) == 0) || | |
(GetConfig().Hashes.SHA256 && len(sha256) == 0) || | |
(GetConfig().Hashes.MD5 && len(md5) == 0) | |
- if rehash || size != d.size || modTime != d.modTime { | |
+ if rehash || size != d.size || !modTime.Equal(d.modTime) { | |
+ log.Warning("rehash: %t | size: %t | modTime: %t", rehash, size != d.size, !modTime.Equal(d.modTime)) | |
h, err := hashFile(GetConfig().Repository + d.path) | |
if err != nil { | |
log.Warning("%s: hashing failed: %s", d.path, err.Error()) | |
@@ -335,6 +343,10 @@ func ScanSource(r *redisobj, stop chan bool) (err error) { | |
"sha256", e.sha256, | |
"md5", e.md5) | |
+ if strings.Contains(e.path, "skin.back-row-3.2.7.zip") { | |
+ log.Warning("modTime to redis: %s", e.modTime) | |
+ } | |
+ | |
// Publish update | |
SendPublish(s.walkRedisConn, FILE_UPDATE, e.path) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment