Skip to content

Commit

Permalink
ignore events in local download tmp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Oct 13, 2020
1 parent d10f3e3 commit 537e74a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/watcher/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package watcher
import (
"context"
"path/filepath"
"strings"
"time"

"github.com/cenkalti/log"
"github.com/putdotio/putio-sync/v2/internal/tmpdir"
"github.com/putdotio/putio-sync/v2/internal/walker"
)

Expand Down Expand Up @@ -36,7 +38,7 @@ func retry(ctx context.Context, dir string, watchFn func(ctx context.Context, di

// This is not the correct place for filtering path names,
// but for now it is okay because this `retry` function is used in all implementations.
if walker.Ignored(filepath.Base(event)) {
if walker.Ignored(filepath.Base(event)) || strings.Contains(event, tmpdir.Name) {
continue
}

Expand Down

0 comments on commit 537e74a

Please sign in to comment.