feat:#104 reordered schedule

This commit is contained in:
masterElmar
2023-12-29 03:29:05 +01:00
parent 5128fcbddd
commit 8a1214e80c
2 changed files with 10 additions and 9 deletions

View File

@@ -26,20 +26,19 @@ func AddSchedules(app *pocketbase.PocketBase) {
course.UpdateCourse(app)
})
// Every sunday at 3am clean all courses (5 segments - minute, hour, day, month, weekday) "0 3 * * 0"
scheduler.MustAdd("cleanFeeds", "0 3 * * 0", func() {
// Every sunday at 1am clean all courses (5 segments - minute, hour, day, month, weekday) "0 3 * * 0"
scheduler.MustAdd("cleanFeeds", "0 1 * * 0", func() {
// clean feeds older than 6 months
feed.ClearFeeds(app.Dao(), 6, time.RealClock{})
})
// Every sunday at 2am fetch all sport events (5 segments - minute, hour, day, month, weekday) "0 2 * * 0"
scheduler.MustAdd("fetchEvents", "0 2 * * 0", func() {
// Every sunday at 3am fetch all sport events (5 segments - minute, hour, day, month, weekday) "0 2 * * 0"
scheduler.MustAdd("fetchSportEvents", "0 3 * * 0", func() {
sport.FetchAndUpdateSportEvents(app)
})
//delete all events and then fetch all events from remote this should be done every day at 4am
scheduler.MustAdd("fetchEvents", "0 4 * * *", func() {
//delete all events and then fetch all events from remote this should be done every sunday at 2am
scheduler.MustAdd("fetchEvents", "0 2 * * 0", func() {
err := events.DeleteAllEvents(app)
if err != nil {
log.Println(err)