Fix reboot timer

This commit is contained in:
2021-05-04 14:41:14 -04:00
parent f82db4166a
commit fbd1f1f8ca
2 changed files with 8 additions and 3 deletions

View File

@ -65,6 +65,13 @@ func status(s *discordgo.Session) {
go runPurge(s)
return
}
func rebootBump() {
time.Sleep(time.Until(config.BumpTime.Add(2 * time.Hour)))
dg.ChannelMessageSend(config.AdminChannel, "!d bump is ready")
}
func storeVerification(v Verification) {
defer log.PanicSafe()
fileURL, _ := url.Parse(v.Photo)

View File

@ -81,9 +81,7 @@ func main() {
log.LogInfo("Thanos is now running. Press CTRL-C to exit.")
go purgeTimer(dg)
if time.Since(config.BumpTime) > 2*time.Hour {
dg.ChannelMessageSend(config.AdminChannel, "!d bump is ready")
}
go rebootBump()
sc := make(chan os.Signal, 1)
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill)
<-sc