From 2a1b5dcffa49ec9edcc55a27ec301ed6f188ac31 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Thu, 12 Sep 2013 23:03:15 +0200 Subject: Made the checkInterval configurable --- checkmails.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'checkmails.go') diff --git a/checkmails.go b/checkmails.go index c30507d..926f057 100644 --- a/checkmails.go +++ b/checkmails.go @@ -8,10 +8,17 @@ import ( "time" ) -const checkInterval = 30 // TODO: Make this configurable +var checkInterval int64 + +func initCheckmails() { + var err error + if checkInterval, err = conf.GetInt("schedules", "checkInterval"); err != nil { + log.Fatalf("Could not read config schedules.checkInterval: %s", err) + } +} func checkmails() { - ticker := time.NewTicker(checkInterval * time.Second) + ticker := time.NewTicker(time.Duration(checkInterval) * time.Second) for { t := <-ticker.C -- cgit v1.2.3-54-g00ecf