mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 01:11:36 +03:00
fix: ack may not exist depending on caller
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user