Added new background jobs

This commit is contained in:
2017-07-02 15:11:42 +02:00
parent 771c16066a
commit 367d31aadb
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,27 @@
package main
import (
"time"
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
color.Yellow("Refreshing osu information")
ticker := time.NewTicker(500 * time.Millisecond)
for user := range arn.MustStreamUsers() {
// Get osu info
if user.RefreshOsuInfo() == nil {
arn.PrettyPrint(user.Accounts.Osu)
user.Save()
}
// Wait for rate limiter
<-ticker.C
}
color.Green("Finished.")
}