mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Add SocketAuthority.close()
This commit is contained in:
parent
0d0bdce337
commit
21d0d43edc
@ -401,7 +401,7 @@ class Server {
|
||||
Logger.info('Watcher Closed')
|
||||
|
||||
return new Promise((resolve) => {
|
||||
this.server.close((err) => {
|
||||
SocketAuthority.close((err) => {
|
||||
if (err) {
|
||||
Logger.error('Failed to close server', err)
|
||||
} else {
|
||||
|
@ -73,6 +73,15 @@ class SocketAuthority {
|
||||
}
|
||||
}
|
||||
|
||||
close(callback) {
|
||||
Logger.info('[SocketAuthority] Shutting down')
|
||||
// This will close all open socket connections, and also close the underlying http server
|
||||
if (this.io)
|
||||
this.io.close(callback)
|
||||
else
|
||||
callback()
|
||||
}
|
||||
|
||||
initialize(Server) {
|
||||
this.Server = Server
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user