Closed fjsousa closed 1 year ago
ready for review
@lispyclouds Want to help review this PR? I see debounce was changed to dedup. Does this also mean that you will never see a duplicate event even after a long time?
I'll try to have a look hopefully today. Will do some local tests.
@fjsousa could you share the link for the fsnotify example that was used as reference here? The link in your comment is probably not what was intended?
@lispyclouds
I've updated the comment with the correct link for the fsnotify example: https://github.com/fsnotify/fsnotify/blob/main/cmd/fsnotify/dedup.go
Sorry it took a while for me, too much tied up in work 😞 but looks good to me! @borkdude the implementation here should get rid of the dups. Its a bit convoluted as Go maps are not concurrent.
Addresses https://github.com/babashka/pod-babashka-fswatcher/issues/18
fsnotify
was creating many file notifications consecutively, which can be disruptive, for instance, if you have a build tool that gets triggered on file changes.fsnotify has an example of deduping based on timers that I implemented here, replacing the debounce logic which was letting duplicates come through.