Shutdown websocket server first

This commit is contained in:
Melon 2023-08-17 14:51:11 +01:00
parent f3c641b82d
commit eddef80671
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -159,6 +159,9 @@ func normalLoad(startUp startUpConfig, wd string) {
exit_reload.ExitReload("Violet", func() { exit_reload.ExitReload("Violet", func() {
allCompilables.Compile() allCompilables.Compile()
}, func() { }, func() {
// close websockets first
ws.Shutdown()
// close http servers // close http servers
if srvApi != nil { if srvApi != nil {
srvApi.Close() srvApi.Close()
@ -169,6 +172,5 @@ func normalLoad(startUp startUpConfig, wd string) {
if srvHttps != nil { if srvHttps != nil {
srvHttps.Close() srvHttps.Close()
} }
ws.Shutdown()
}) })
} }