This commit is contained in:
syuilo 2023-05-29 13:21:26 +09:00
parent fd7b77c542
commit b6f21b6edb
16 changed files with 104 additions and 21 deletions

View file

@ -222,7 +222,13 @@ export class ServerService implements OnApplicationShutdown {
await fastify.ready();
}
async onApplicationShutdown(signal: string): Promise<void> {
@bindThis
public async dispose(): Promise<void> {
await this.#fastify.close();
}
@bindThis
async onApplicationShutdown(signal: string): Promise<void> {
await this.dispose();
}
}

View file

@ -359,7 +359,12 @@ export class ApiCallService implements OnApplicationShutdown {
}
@bindThis
public onApplicationShutdown(signal?: string | undefined) {
public dispose(): void {
clearInterval(this.userIpHistoriesClearIntervalId);
}
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
}