* Periodic flush for long-lived processes (MCP daemon / serve). Unref'd so * it never keeps the process alive.
(everyMs: number = 6 * 60 * 60_000)
| 316 | * it never keeps the process alive. |
| 317 | */ |
| 318 | startInterval(everyMs: number = 6 * 60 * 60_000): void { |
| 319 | if (this.intervalHandle || !this.isEnabled()) return; |
| 320 | this.maybeFlush(); |
| 321 | this.intervalHandle = setInterval(() => this.maybeFlush(), everyMs); |
| 322 | this.intervalHandle.unref(); |
| 323 | } |
| 324 | |
| 325 | stopInterval(): void { |
| 326 | if (this.intervalHandle) { |
no test coverage detected