1
0
Fork 0

Verbose shutdown

This commit is contained in:
Gregory Eremin 2014-07-12 17:58:56 +07:00
parent 313677aa48
commit da544b85b5
1 changed files with 9 additions and 4 deletions

13
main.go
View File

@ -15,19 +15,24 @@ func HandleShutdown() {
go func() { go func() {
<-ch <-ch
SaveState() SaveState()
Log("State successfully persisted") Log("State successfully persisted")
storage.Close() storage.Close()
rollbar.Wait()
Log("Storage closed") Log("Storage closed")
Log("Server stopped")
os.Exit(1) Log("Waiting for rollbar...")
rollbar.Wait()
Log("Stopped")
os.Exit(0)
}() }()
} }
func main() { func main() {
SetupLogging()
SetupConfig() SetupConfig()
SetupLogging()
SetupStorage() SetupStorage()
SetupServer() SetupServer()
HandleShutdown() HandleShutdown()