Refactor
This commit is contained in:
parent
46a3715bae
commit
7892657362
29
jobs/jobs.go
29
jobs/jobs.go
@ -23,21 +23,20 @@ var colorPool = []*color.Color{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var jobs = map[string]time.Duration{
|
var jobs = map[string]time.Duration{
|
||||||
"forum-activity": 1 * time.Minute,
|
"forum-activity": 1 * time.Minute,
|
||||||
"active-users": 5 * time.Minute,
|
"active-users": 5 * time.Minute,
|
||||||
"anime-ratings": 10 * time.Minute,
|
"anime-ratings": 10 * time.Minute,
|
||||||
"airing-anime": 10 * time.Minute,
|
"airing-anime": 10 * time.Minute,
|
||||||
"statistics": 15 * time.Minute,
|
"statistics": 15 * time.Minute,
|
||||||
"popular-anime": 20 * time.Minute,
|
"popular-anime": 20 * time.Minute,
|
||||||
"avatars": 1 * time.Hour,
|
"avatars": 1 * time.Hour,
|
||||||
"test": 1 * time.Hour,
|
"test": 1 * time.Hour,
|
||||||
"twist": 2 * time.Hour,
|
"twist": 2 * time.Hour,
|
||||||
"search-index": 2 * time.Hour,
|
"search-index": 2 * time.Hour,
|
||||||
"refresh-episodes": 10 * time.Hour,
|
"refresh-episodes": 10 * time.Hour,
|
||||||
"refresh-track-titles": 10 * time.Hour,
|
"refresh-osu": 12 * time.Hour,
|
||||||
"refresh-osu": 12 * time.Hour,
|
"sync-anime": 12 * time.Hour,
|
||||||
"sync-anime": 12 * time.Hour,
|
"sync-shoboi": 24 * time.Hour,
|
||||||
"sync-shoboi": 24 * time.Hour,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -24,14 +24,14 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sync(track *arn.SoundTrack) {
|
func sync(track *arn.SoundTrack) {
|
||||||
for _, media := range track.Media {
|
// for _, media := range track.Media {
|
||||||
media.RefreshMetaData()
|
// media.RefreshMetaData()
|
||||||
println(media.Service, media.Title)
|
// println(media.Service, media.Title)
|
||||||
}
|
// }
|
||||||
|
|
||||||
err := track.Save()
|
// err := track.Save()
|
||||||
|
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
@ -37,23 +37,23 @@ func TestRoutes(t *testing.T) {
|
|||||||
func TestInterfaceImplementations(t *testing.T) {
|
func TestInterfaceImplementations(t *testing.T) {
|
||||||
// API interfaces
|
// API interfaces
|
||||||
var creatable = reflect.TypeOf((*api.Creatable)(nil)).Elem()
|
var creatable = reflect.TypeOf((*api.Creatable)(nil)).Elem()
|
||||||
var updatable = reflect.TypeOf((*api.Updatable)(nil)).Elem()
|
var editable = reflect.TypeOf((*api.Editable)(nil)).Elem()
|
||||||
var actionable = reflect.TypeOf((*api.Actionable)(nil)).Elem()
|
var actionable = reflect.TypeOf((*api.Actionable)(nil)).Elem()
|
||||||
var collection = reflect.TypeOf((*api.Collection)(nil)).Elem()
|
var collection = reflect.TypeOf((*api.Collection)(nil)).Elem()
|
||||||
|
|
||||||
// Required interface implementations
|
// Required interface implementations
|
||||||
var interfaceImplementations = map[string][]reflect.Type{
|
var interfaceImplementations = map[string][]reflect.Type{
|
||||||
"User": []reflect.Type{
|
"User": []reflect.Type{
|
||||||
updatable,
|
editable,
|
||||||
},
|
},
|
||||||
"Thread": []reflect.Type{
|
"Thread": []reflect.Type{
|
||||||
creatable,
|
creatable,
|
||||||
updatable,
|
editable,
|
||||||
actionable,
|
actionable,
|
||||||
},
|
},
|
||||||
"Post": []reflect.Type{
|
"Post": []reflect.Type{
|
||||||
creatable,
|
creatable,
|
||||||
updatable,
|
editable,
|
||||||
actionable,
|
actionable,
|
||||||
},
|
},
|
||||||
"SoundTrack": []reflect.Type{
|
"SoundTrack": []reflect.Type{
|
||||||
|
Loading…
Reference in New Issue
Block a user