change election leader mechanism

This commit is contained in:
Pierre
2026-02-16 00:44:59 +01:00
parent a6374225fb
commit fb55663c3a
10 changed files with 226 additions and 664 deletions
+9
View File
@@ -68,6 +68,15 @@ func (p *Poller) Start() error {
log.Println("[WatcherPoller] Starting file watcher polling service")
// Clear file:events stream on startup to prevent duplicate events from accumulating
// across container restarts. Since in-memory state is empty, all files will be
// re-emitted as "add" events - we need a fresh stream to match.
if p.dispatcher != nil {
if err := p.dispatcher.EmitReset("startup"); err != nil {
log.Printf("[WatcherPoller] Warning: failed to clear stream on startup: %v", err)
}
}
// Initial sync with watcher configurations
go p.syncWithWatchers()