Skip to content

Commit

Permalink
don't filter events in watcher
Browse files Browse the repository at this point in the history
filtering on create and write doesn't work with the way git update files
  • Loading branch information
umputun committed Dec 14, 2023
1 parent 5d5cdfe commit 00e61ee
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/bot/spam.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,10 @@ func (s *SpamFilter) watch(ctx context.Context, delay time.Duration) error {
if !ok {
return
}
if event.Has(fsnotify.Write) || event.Has(fsnotify.Create) {
log.Printf("[DEBUG] file %q updated, op: %v", event.Name, event.Op)
if !reloadPending {
reloadPending = true
reloadTimer.Reset(delay)
}
log.Printf("[DEBUG] file %q updated, op: %v", event.Name, event.Op)
if !reloadPending {
reloadPending = true
reloadTimer.Reset(delay)
}
case <-reloadTimer.C:
if reloadPending {
Expand Down

0 comments on commit 00e61ee

Please sign in to comment.