mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 21:03:29 +00:00
refactor: improve shutdown cleanup
This commit is contained in:
committed by
Carlos Valente
parent
871a6b46c8
commit
4408bdb0d3
@@ -72,10 +72,17 @@ class OscServer implements IAdapter {
|
||||
});
|
||||
this.udpSocket.bind(port);
|
||||
}
|
||||
shutdown() {
|
||||
shutdown(): Promise<void> {
|
||||
logger.info(LogOrigin.Rx, 'OSC: Closing server');
|
||||
this.udpSocket?.close();
|
||||
const socket = this.udpSocket;
|
||||
this.udpSocket = null;
|
||||
if (!socket) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
socket.close(() => resolve());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user