Added new background jobs
This commit is contained in:
27
jobs/refresh-osu/refresh-osu.go
Normal file
27
jobs/refresh-osu/refresh-osu.go
Normal 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.")
|
||||
}
|
Reference in New Issue
Block a user