Skip to content

Commit

Permalink
ignore events for .syncthing.*.tmp files
Browse files Browse the repository at this point in the history
  • Loading branch information
plouj committed Feb 28, 2016
1 parent df9ecf2 commit bce839e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/fswatcher/fswatcher.go
Expand Up @@ -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
}
Expand Down Expand Up @@ -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.