mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
- Change error messages - backend and update: changed files name to ticker.go - Update README, Makefile - Added nodemon - website: URL type now is database.URL - backend: Remove unused http info - Upgrade deps
28 lines
307 B
Go
28 lines
307 B
Go
package backend
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gitlab.com/gaming0skar123/go/pingbot/config"
|
|
)
|
|
|
|
func Ticker() {
|
|
// Ping on Start
|
|
ping()
|
|
|
|
ticker := time.NewTicker(config.PingBot_Ticker)
|
|
|
|
quit := make(chan struct{})
|
|
|
|
for {
|
|
select {
|
|
case <-ticker.C:
|
|
ping()
|
|
case <-quit:
|
|
ticker.Stop()
|
|
|
|
return
|
|
}
|
|
}
|
|
}
|