about summary refs log tree commit diff stats
path: root/svc/init.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-13 23:58:17 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-13 23:58:22 -0400
commitdf8fa27ffa596e02d0560aa9238f194911c03e56 (patch)
tree882ddbc7cfa6be1123a77fc84b01c124623707d4 /svc/init.go
parentc4130e200d1282c1637c6f79332593026c87993d (diff)
downloadgetwtxt-df8fa27ffa596e02d0560aa9238f194911c03e56.tar.gz
on SIGINT, push to DB before shutting down
also logging elapsed time for DB pulls
Diffstat (limited to 'svc/init.go')
-rw-r--r--svc/init.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/svc/init.go b/svc/init.go
index edd081c..b00f45d 100644
--- a/svc/init.go
+++ b/svc/init.go
@@ -109,8 +109,12 @@ func watchForInterrupt() {
 
 	go func() {
 		for sigint := range c {
-			log.Printf("Caught %v. Cleaning up ...\n", sigint)
+			log.Printf("Caught %v\n", sigint)
 
+			log.Printf("Pushing to database ...\n")
+			pushDB()
+
+			log.Printf("Cleaning up ...\n")
 			killTickers()
 			killDB()