fix(metrics): clear startPromise on stop() to allow restart
FIX: startPromise was never cleared after stop(), causing start() to return the old resolved promise instead of creating a new server. This broke any flow that stops and restarts metrics (config reloads, tests). Now stop() clears startPromise, allowing proper server restart.
This commit is contained in:
@@ -1133,9 +1133,13 @@ export class MetricsServer {
|
||||
|
||||
/**
|
||||
* Stop the metrics HTTP server
|
||||
* FIX: Clears startPromise to allow restart after stop
|
||||
*/
|
||||
stop(): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
// FIX: Clear cached promise so start() can be called again
|
||||
this.startPromise = null
|
||||
|
||||
if (this.collectInterval) {
|
||||
clearInterval(this.collectInterval)
|
||||
this.collectInterval = null
|
||||
|
||||
Reference in New Issue
Block a user