Skip to content
Permalink
Browse files

ignore events for .syncthing.*.tmp files

  • Loading branch information...
plouj committed Feb 28, 2016
1 parent df9ecf2 commit bce839e929bf3e257199896220436c8d489a9ecc
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/fswatcher/fswatcher.go
@@ -105,7 +105,9 @@ func (watcher *FsWatcher) watchFilesystem() {
func (watcher *FsWatcher) newFsEvent(eventPath string) *FsEvent {
if isSubpath(eventPath, watcher.folderPath) {
path := relativePath(eventPath, watcher.folderPath)
return &FsEvent{path}
if !isSpecialPath(path) {
return &FsEvent{path}
}
}
return nil
}
@@ -184,3 +186,7 @@ func (watcher *FsWatcher) skipPathChangedByUs(event events.Event) {
l.Debugf("Skipping notification for finished path: %s\n", path)
watcher.removeEventIfPresent(path)
}

func isSpecialPath(path string) bool {
return strings.Contains(path, ".syncthing.") && strings.HasSuffix(path, ".tmp")
}

0 comments on commit bce839e

Please sign in to comment.
You can’t perform that action at this time.