mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-05-06 05:26:33 -05:00
Don't panic if closing a listener errors
This commit is contained in:
parent
b70c693d26
commit
f23a6bf8af
|
|
@ -110,7 +110,6 @@ func Shutdown() {
|
|||
db.Close()
|
||||
|
||||
logging.Notice("GPCM", "Saved", aurora.Cyan(len(sessions)), "sessions")
|
||||
|
||||
}
|
||||
|
||||
func CloseConnection(index uint64) {
|
||||
|
|
|
|||
6
main.go
6
main.go
|
|
@ -359,8 +359,10 @@ func frontendMain(noSignal, noBackend bool) {
|
|||
rpcMutex.Unlock()
|
||||
|
||||
logging.Notice("FRONTEND", "Sending RPCPacket.Shutdown")
|
||||
common.ShouldNotError(rpcClient.Call("RPCPacket.Shutdown", "", nil))
|
||||
common.ShouldNotError(rpcClient.Close())
|
||||
if err := rpcClient.Call("RPCPacket.Shutdown", "", nil); err != nil {
|
||||
logging.Error("FRONTEND", "Error during backend shutdown:", err.Error())
|
||||
}
|
||||
_ = rpcClient.Close()
|
||||
}
|
||||
|
||||
// startFrontendServer starts the frontend RPC server.
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ func StartServer(reload bool) {
|
|||
|
||||
// Close the listener when the application closes.
|
||||
defer func() {
|
||||
common.ShouldNotError(conn.Close())
|
||||
_ = conn.Close()
|
||||
}()
|
||||
logging.Notice("NATNEG", "Listening on", aurora.BrightCyan(address))
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ func StartServer(reload bool) {
|
|||
|
||||
// Close the listener when the application closes.
|
||||
defer func() {
|
||||
common.ShouldNotError(conn.Close())
|
||||
_ = conn.Close()
|
||||
}()
|
||||
logging.Notice("QR2", "Listening on", aurora.BrightCyan(address))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user