mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Add SocketAuthority.close()
This commit is contained in:
parent
0d0bdce337
commit
21d0d43edc
@ -401,7 +401,7 @@ class Server {
|
|||||||
Logger.info('Watcher Closed')
|
Logger.info('Watcher Closed')
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.server.close((err) => {
|
SocketAuthority.close((err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
Logger.error('Failed to close server', err)
|
Logger.error('Failed to close server', err)
|
||||||
} else {
|
} 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) {
|
initialize(Server) {
|
||||||
this.Server = Server
|
this.Server = Server
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user