mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
28 lines
319 B
Go
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
|
|
}
|
|
}
|
|
}
|