Send RPC leave messages on shutdown

master
HimbeerserverDE 2021-05-02 12:55:42 +02:00
parent 757de005ae
commit aa03e87e00
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
1 changed files with 2 additions and 3 deletions

5
end.go
View File

@ -21,18 +21,17 @@ func End(crash, reconnect bool) {
clt.CloseWith(reason, "", reconnect)
}
time.Sleep(time.Second)
rpcSrvMu.Lock()
for srv := range rpcSrvs {
srv.Close()
}
rpcSrvMu.Unlock()
time.Sleep(time.Second)
Announce(AnnounceDelete)
log.Writer().(*Logger).Close()
gocurses.End()
if crash {