Add JS docs for server stop

This commit is contained in:
advplyr 2023-12-28 16:32:21 -06:00
parent 21d0d43edc
commit 9a634e0de5
2 changed files with 11 additions and 2 deletions

View File

@ -395,6 +395,10 @@ class Server {
res.sendStatus(200) res.sendStatus(200)
} }
/**
* Gracefully stop server
* Stops watcher and socket server
*/
async stop() { async stop() {
Logger.info('=== Stopping Server ===') Logger.info('=== Stopping Server ===')
await this.watcher.close() await this.watcher.close()

View File

@ -73,6 +73,11 @@ class SocketAuthority {
} }
} }
/**
* Closes the Socket.IO server and disconnect all clients
*
* @param {Function} callback
*/
close(callback) { close(callback) {
Logger.info('[SocketAuthority] Shutting down') Logger.info('[SocketAuthority] Shutting down')
// This will close all open socket connections, and also close the underlying http server // This will close all open socket connections, and also close the underlying http server