From 00e61ee40a659b4c327c502ac3f1ec0b06b80b36 Mon Sep 17 00:00:00 2001 From: Umputun Date: Thu, 14 Dec 2023 11:11:17 -0600 Subject: [PATCH] don't filter events in watcher filtering on create and write doesn't work with the way git update files --- app/bot/spam.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/bot/spam.go b/app/bot/spam.go index 19daab5d..5e124af6 100644 --- a/app/bot/spam.go +++ b/app/bot/spam.go @@ -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 {