Schedule refresh

This commit is contained in:
daru
2022-04-18 01:46:45 +02:00
parent b0a68b017e
commit 8fe7bf4d4b
2 changed files with 76 additions and 23 deletions

17
huso.go
View File

@@ -56,7 +56,7 @@ func main() {
// cache init
var err error
animeCache, err = bigcache.NewBigCache(bigcache.DefaultConfig(6 * time.Hour))
animeCache, err = bigcache.NewBigCache(bigcache.DefaultConfig(7 * time.Hour))
if err != nil {
log.Fatal(err)
}
@@ -85,9 +85,11 @@ func main() {
}
defer db.Close()
initSeason()
Arbeit()
LangeArbeit()
go Arbeiten()
go LangeArbeiten()
go RunWebserv()
@@ -96,14 +98,3 @@ func main() {
<-sc
}
func initSeason() {
_, bytes, err := GetSeasonDataAll()
if err != nil {
color.Errorln(err.Error())
}
err = seasoncache.Set(seasonApiJikan, bytes)
if err != nil {
color.Errorln(err.Error())
}
}