mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 03:20:11 +00:00
Avoid background update goroutines in api tests
This commit is contained in:
parent
2e0d974bb3
commit
fd13d7f59e
1 changed files with 8 additions and 5 deletions
|
|
@ -209,11 +209,14 @@ func NewRouter(cfg *config.Config, monitor *monitoring.Monitor, mtMonitor *monit
|
|||
r.setupRoutes()
|
||||
log.Debug().Msg("Routes registered successfully")
|
||||
|
||||
// Start forwarding update progress to WebSocket
|
||||
go r.forwardUpdateProgress()
|
||||
|
||||
// Start background update checker
|
||||
go r.backgroundUpdateChecker()
|
||||
// Package tests construct many routers in parallel and expect them to stay
|
||||
// side-effect free. Skipping these long-lived goroutines under `go test`
|
||||
// avoids nondeterministic update checks and leaked background work while
|
||||
// preserving the normal runtime behavior.
|
||||
if !runningUnderGoTest() {
|
||||
go r.forwardUpdateProgress()
|
||||
go r.backgroundUpdateChecker()
|
||||
}
|
||||
|
||||
// Load system settings once at startup and cache them
|
||||
r.reloadSystemSettings()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue