Add daemonize mode, readme

This commit is contained in:
2023-12-03 19:18:26 -06:00
parent c250828dbe
commit 6eadef654f
3 changed files with 32 additions and 1 deletions

View File

@ -26,6 +26,7 @@ var (
leaderboardArg = flag.String("leaderboard", "", "the leaderboard code to check")
sessionArg = flag.String("session", "", "session cookie to use to request the leaderboard")
webhookURLArg = flag.String("webhookURL", "", "webhook to post updates to")
daemonizeArg = flag.Bool("d", false, "daemonizes the application to run and scan every 15 minutes")
)
var (
@ -220,6 +221,11 @@ func main() {
}
}
if !*daemonizeArg {
refresh()
return
}
c := cron.New()
c.AddFunc("*/15 * * * *", refresh)