From da544b85b54f94a3e3cbeeb49b19bbcf8685fdef Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sat, 12 Jul 2014 17:58:56 +0700 Subject: [PATCH] Verbose shutdown --- main.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index c9cafbb..158a726 100644 --- a/main.go +++ b/main.go @@ -15,19 +15,24 @@ func HandleShutdown() { go func() { <-ch + SaveState() Log("State successfully persisted") + storage.Close() - rollbar.Wait() Log("Storage closed") - Log("Server stopped") - os.Exit(1) + + Log("Waiting for rollbar...") + rollbar.Wait() + + Log("Stopped") + os.Exit(0) }() } func main() { - SetupLogging() SetupConfig() + SetupLogging() SetupStorage() SetupServer() HandleShutdown()