fix: ack may not exist depending on caller

This commit is contained in:
izzy
2025-12-19 14:16:30 +00:00
parent 00bafb899d
commit a2d4439e48
2 changed files with 4 additions and 4 deletions

View File

@@ -37,8 +37,8 @@ export class MaintenanceWebsocketRepository implements OnGatewayConnection, OnGa
afterInit(websocketServer: Server) {
this.logger.log('Initialized websocket server');
websocketServer.on('AppRestart', (_, ack) => {
ack('ok');
websocketServer.on('AppRestart', (_, ack?: (ok: 'ok') => void) => {
ack?.('ok');
this.appRepository.exitApp();
});
}

View File

@@ -31,8 +31,8 @@ export class MaintenanceService extends BaseService {
}
@OnEvent({ name: 'AppRestart', server: true })
onRestart(_: undefined, ack: (ok: 'ok') => void): void {
ack('ok');
onRestart(_: undefined, ack?: (ok: 'ok') => void): void {
ack?.('ok');
this.appRepository.exitApp();
}