Skip to content

Commit

Permalink
Push the check for each file instead of dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ravishankar15 committed Dec 13, 2024
1 parent fa949e3 commit 87aac3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/component/local/file_match/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ func (w *watch) getPaths() ([]discovery.Target, error) {
continue
}

if w.ignoreOlderThan != 0 && fi.ModTime().Before(time.Now().Add(-w.ignoreOlderThan)) {
if fi.IsDir() {
continue
}

if fi.IsDir() {
if w.ignoreOlderThan != 0 && fi.ModTime().Before(time.Now().Add(-w.ignoreOlderThan)) {
continue
}

dt := discovery.Target{}
for dk, v := range w.target {
dt[dk] = v
Expand Down

0 comments on commit 87aac3e

Please sign in to comment.