summary refs log tree commit diff stats
path: root/svc/periodic.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-12-08 02:22:53 -0500
committerBen Morrison <ben@gbmor.dev>2019-12-08 02:22:53 -0500
commit34d7903e48262fce8b102c2c0b272a00b8941144 (patch)
treec45dd88a479fed4916a0ef82901e8a0f2135ed2e /svc/periodic.go
parent85f600064f5a3386be081653f1050066beee985b (diff)
downloadgetwtxt-34d7903e48262fce8b102c2c0b272a00b8941144.tar.gz
tick.exit channels now using struct{} instead of bool
Diffstat (limited to 'svc/periodic.go')
-rw-r--r--svc/periodic.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/svc/periodic.go b/svc/periodic.go
index 9868d94..0a07371 100644
--- a/svc/periodic.go
+++ b/svc/periodic.go
@@ -37,7 +37,7 @@ import (
 type tick struct {
 	isDB bool
 	t    *time.Ticker
-	exit chan bool
+	exit chan struct{}
 }
 
 // Creates a new instance of a tick
@@ -45,7 +45,7 @@ func initTicker(db bool, interval time.Duration) *tick {
 	return &tick{
 		isDB: db,
 		t:    time.NewTicker(interval),
-		exit: make(chan bool, 1),
+		exit: make(chan struct{}, 1),
 	}
 }
 
@@ -55,8 +55,8 @@ func initTicker(db bool, interval time.Duration) *tick {
 func killTickers() {
 	ct := <-cTickC
 	dt := <-dbTickC
-	ct.exit <- true
-	dt.exit <- true
+	ct.exit <- struct{}{}
+	dt.exit <- struct{}{}
 }
 
 // Waits for a signal from the database