summary refs log tree commit diff stats
path: root/svc/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'svc/init.go')
-rw-r--r--svc/init.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/svc/init.go b/svc/init.go
index 537119c..d7419de 100644
--- a/svc/init.go
+++ b/svc/init.go
@@ -111,19 +111,18 @@ func watchForInterrupt() {
 
 	go func() {
 		for sigint := range c {
-
 			log.Printf("Caught %v. Cleaning up ...\n", sigint)
-			confObj.Mu.RLock()
-			log.Printf("Closing database connection to %v...\n", confObj.DBPath)
 
 			killTickers()
 			killDB()
 
+			confObj.Mu.RLock()
+			log.Printf("Closed database connection to %v\n", confObj.DBPath)
 			if !confObj.StdoutLogging {
 				closeLog <- true
 			}
-
 			confObj.Mu.RUnlock()
+
 			close(dbChan)
 			close(closeLog)