go-cdn/update/checkUpdates.go

29 lines
320 B
Go
Raw Permalink Normal View History

2021-07-08 21:30:32 +00:00
package update
import (
"time"
"gitlab.com/gaming0skar123/go/cdn/config"
)
func CheckUpdates() {
2021-07-08 21:30:32 +00:00
// Check on start
Update()
2021-07-08 21:30:32 +00:00
ticker := time.NewTicker(config.Latest_Version_Check)
quit := make(chan struct{})
for {
select {
case <-ticker.C:
Update()
2021-07-08 21:30:32 +00:00
case <-quit:
ticker.Stop()
return
}
}
}