Add daemonize mode, readme
This commit is contained in:
6
main.go
6
main.go
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user