mirror of
https://github.com/MedzikUser/go-cdn
synced 2024-08-15 03:19:36 +00:00
- Added github workflows and dependabot - Added goreleaser - The Automatic Update system has been changed - Changed DB connect from init to Connect()
28 lines
320 B
Go
28 lines
320 B
Go
package update
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gitlab.com/gaming0skar123/go/cdn/config"
|
|
)
|
|
|
|
func CheckUpdates() {
|
|
// 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
|
|
}
|
|
}
|
|
}
|