first watch action for a file event wins

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2024-12-06 14:39:21 +01:00 committed by Nicolas De loof
parent 0861e68450
commit 254224c182
1 changed files with 4 additions and 1 deletions

View File

@ -371,7 +371,10 @@ func batchDebounceEvents(ctx context.Context, clock clockwork.Clock, delay time.
flushEvents()
return
}
seen[e.HostPath] = e
if _, ok := seen[e.HostPath]; !ok {
// already know updated path, first rule in watch configuration wins
seen[e.HostPath] = e
}
t.Reset(delay)
}
}