go-pingbot/backend/ticker.go
Medzik 3432a74d23 feat: Add Cache URLs and Database config from toml file
- Added Cache URLs from Database
- and Database Name and Collection set from toml config file
2021-08-11 10:35:51 +00:00

28 lines
328 B
Go

package backend
import (
"time"
"gitlab.com/gaming0skar123/go/pingbot/config"
)
func Ticker() {
// On Start
cache()
ping()
ticker := time.NewTicker(config.Toml.Backend.Ping * time.Minute)
quit := make(chan struct{})
for {
select {
case <-ticker.C:
ping()
case <-quit:
ticker.Stop()
return
}
}
}