Synchronize server startup

This prevents an edge case where the server begins processing inbound API / AP requests before any of the chart / management daemons are ready, potentially leading to incorrect chart statistics.
This commit is contained in:
Hazelnoot 2024-11-27 23:19:14 -05:00
parent f59af78d8a
commit ffbdfa9123
3 changed files with 12 additions and 11 deletions

View file

@ -33,7 +33,7 @@ export class QueueStatsService implements OnApplicationShutdown {
* Report queue stats regularly
*/
@bindThis
public start(): void {
public async start(): Promise<void> {
const log = [] as any[];
ev.on('requestQueueStatsLog', x => {
@ -82,7 +82,7 @@ export class QueueStatsService implements OnApplicationShutdown {
activeInboxJobs = 0;
};
tick();
await tick();
this.intervalId = setInterval(tick, interval);
}