go-pingbot/update/updater.go
2021-07-14 13:23:30 +02:00

28 lines
319 B
Go

package update
import (
"time"
"gitlab.com/gaming0skar123/go/pingbot/config"
)
func Updater() {
// Check on start
Update()
ticker := time.NewTicker(config.Latest_Version_Check)
quit := make(chan struct{})
for {
select {
case <-ticker.C:
Update()
case <-quit:
ticker.Stop()
return
}
}
}