fix(websocket): start the event loop and throttle drop warnings

The app built the websocket server but never called Start, so nothing read the 256-slot broadcast channel. After the first 256 events every event was dropped with a warning, and dashboard clients blocked forever on the unbuffered register channel, leaking a goroutine per connection and never receiving events. Run now starts the loop with the other workers. Dropped events are counted in gohoarder_websocket_events_dropped_total and warned about at most once a minute.
This commit is contained in:
2026-11-23 12:56:32 +00:00
parent c98720c02e
commit 6f604367da
4 changed files with 78 additions and 7 deletions
+8
View File
@@ -62,6 +62,14 @@ var (
[]string{"reason"}, // ttl, lru, manual
)
// WebSocketEventsDropped counts realtime events dropped because the broadcast channel was full.
WebSocketEventsDropped = promauto.NewCounter(
prometheus.CounterOpts{
Name: "gohoarder_websocket_events_dropped_total",
Help: "Realtime dashboard events dropped because the broadcast channel was full",
},
)
// Storage metrics
StorageOperations = promauto.NewCounterVec(
prometheus.CounterOpts{