瀏覽代碼

Merge pull request #2462 from AudriusButkevicius/mtimes

Use virtualMtime when deciding if a file is up to date
Jakob Borg 10 年之前
父節點
當前提交
56f1c295b6
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lib/model/rwfolder.go

+ 2 - 1
lib/model/rwfolder.go

@@ -948,7 +948,8 @@ func (p *rwFolder) handleFile(file protocol.FileInfo, copyChan chan<- copyBlocks
 		// changes that we don't know about yet and we should scan before
 		// changes that we don't know about yet and we should scan before
 		// touching the file. If we can't stat the file we'll just pull it.
 		// touching the file. If we can't stat the file we'll just pull it.
 		if info, err := osutil.Lstat(realName); err == nil {
 		if info, err := osutil.Lstat(realName); err == nil {
-			if info.ModTime().Unix() != curFile.Modified || info.Size() != curFile.Size() {
+			mtime := p.virtualMtimeRepo.GetMtime(file.Name, info.ModTime())
+			if mtime.Unix() != curFile.Modified || info.Size() != curFile.Size() {
 				l.Debugln("file modified but not rescanned; not pulling:", realName)
 				l.Debugln("file modified but not rescanned; not pulling:", realName)
 				// Scan() is synchronous (i.e. blocks until the scan is
 				// Scan() is synchronous (i.e. blocks until the scan is
 				// completed and returns an error), but a scan can't happen
 				// completed and returns an error), but a scan can't happen