diff options
Diffstat (limited to 'svc/init.go')
-rw-r--r-- | svc/init.go | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/svc/init.go b/svc/init.go index 71527cf..537119c 100644 --- a/svc/init.go +++ b/svc/init.go @@ -30,9 +30,12 @@ var confObj = &Configuration{} // Signals to close the log file var closeLog = make(chan bool, 1) -// Used to transmit database pointer, database ticker, -// and cache ticker after initialization +// Used to transmit database pointer var dbChan = make(chan dbase, 1) + +// Used to transmit the wrapped tickers +// corresponding to the in-memory cache +// or the on-disk database. var dbTickC = make(chan *tick, 1) var cTickC = make(chan *tick, 1) @@ -100,22 +103,6 @@ func checkFlags() { } } -// Starts the tickers that periodically: -// - pull new user statuses into cache -// - push cached data to disk -func initPersistence() { - confObj.Mu.RLock() - cacheTkr := initTicker(false, confObj.CacheInterval) - dbTkr := initTicker(true, confObj.DBInterval) - confObj.Mu.RUnlock() - - go dataTimer(cacheTkr) - go dataTimer(dbTkr) - - dbTickC <- dbTkr - cTickC <- cacheTkr -} - // Watch for SIGINT aka ^C // Close the log file then exit func watchForInterrupt() { |