Files
beads/cmd/bd/daemon_watcher.go
Charles P. Cross 195091711e fix(daemon): deduplicate file and git ref change log messages
The daemon.log was showing duplicate log messages:
- 'File change detected' appeared 4x for a single file change
- 'Git ref change detected' appeared 2x for a single ref update

Root cause:
- fsnotify generates multiple events (Write, Create, Chmod) for single file ops
- Both parent directory and file watchers can trigger for the same change
- Multiple git ref files may be updated simultaneously

Fix:
- Add log deduplication with 500ms window (matching debouncer window)
- Track last log time for file changes and git ref changes separately
- Only log if enough time has passed since last log of same type
- Still trigger debouncer for every event (functionality unchanged)

This reduces log noise while maintaining full functionality.
2025-12-22 19:02:42 -05:00

10 KiB