Merge pull request #8

fix(metrics): clear startPromise on stop() to allow restart
This commit is contained in:
Renato Alcara
2026-01-20 01:30:37 -03:00
committed by GitHub
+4
View File
@@ -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