Add graceful shutdown to channel server

This commit is contained in:
Andrew Gutekanst
2020-01-13 18:36:55 -05:00
parent 30219b8bcf
commit 5f1d429c12
3 changed files with 43 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"os/signal"
"syscall"
"time"
"github.com/Andoryuuta/Erupe/config"
"github.com/Andoryuuta/Erupe/server/channelserver"
@@ -113,7 +114,10 @@ func main() {
<-c
logger.Info("Trying to shutdown gracefully.")
channelServer.Shutdown()
signServer.Shutdown()
entranceServer.Shutdown()
launcherServer.Shutdown()
time.Sleep(5 * time.Second)
}