perf(ingest): reduce database work and buffer MQTT bursts (#179)

This commit is contained in:
MrAlders0n authored and GitHub committed 2026-09-27 22:56:03 -04:00
1 parent 876d99704f
commit 1887fccb8d
9 files changed
+544 -50

No files matched your search

+5 -2
View File
@@ -12,6 +12,7 @@ import (
"os"
"os/signal"
"strconv"
"sync"
"syscall"
"time"
@@ -284,8 +285,9 @@ func main() {
broker2.SetCacheInvalidators(cr.InvalidateNode, cr.InvalidateObserver)
}
go broker1.Start(ctx)
go broker2.Start(ctx)
var ingestWorkers sync.WaitGroup
ingestWorkers.Go(func() { broker1.Start(ctx) })
ingestWorkers.Go(func() { broker2.Start(ctx) })
tasks := []background.Task{
background.ViewRefreshTask(store, resolved.ViewRefreshInterval),
@@ -343,6 +345,7 @@ func main() {
if err := srv.Shutdown(shutdownCtx); err != nil {
slog.Error("server shutdown error", "component", "startup", "error", err)
}
ingestWorkers.Wait()
coalescer.Flush(shutdownCtx)
}