Update gitignore and notify only on create (write was being spammed)

This commit is contained in:
Dave
2024-08-31 12:56:07 +02:00
committed by PhatPhuckDave
parent 77283822fd
commit ee4003f4f1
3 changed files with 11 additions and 2 deletions

7
.gitignore vendored
View File

@@ -1,2 +1,9 @@
test
main.log
vendor
.env
folder_mail_notifier.te
folder_mail_notifier.pp
folder-mail-notifier
my-notifier.pp
my-notifier.te

2
go.mod
View File

@@ -1,6 +1,6 @@
module folder-mail-notifier
go 1.23.0
go 1.22.0
require (
github.com/joho/godotenv v1.5.1

View File

@@ -23,7 +23,9 @@ func WatchRecursively(root string, changeHandler func(fsnotify.Event)) error {
if !ok {
return
}
changeHandler(event)
if fsnotify.Create == event.Op {
changeHandler(event)
}
case err, ok := <-watcher.Errors:
if !ok {
return