mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-07 12:19:17 +02:00
feature:#150 added slog and changed signatures
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"htwkalender/service/feed"
|
||||
"htwkalender/service/fetch/sport"
|
||||
"htwkalender/service/functions/time"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
func AddSchedules(app *pocketbase.PocketBase) {
|
||||
@@ -19,17 +20,20 @@ func AddSchedules(app *pocketbase.PocketBase) {
|
||||
// Every three hours update all courses (5 segments - minute, hour, day, month, weekday) "0 */3 * * *"
|
||||
// Every 10 minutes update all courses (5 segments - minute, hour, day, month, weekday) "*/10 * * * *"
|
||||
scheduler.MustAdd("updateCourse", "0 */3 * * *", func() {
|
||||
slog.Info("Started updating courses schedule")
|
||||
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() {
|
||||
// clean feeds older than 6 months
|
||||
slog.Info("Started cleaning feeds schedule")
|
||||
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() {
|
||||
slog.Info("Started fetching sport events schedule")
|
||||
sport.FetchAndUpdateSportEvents(app)
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user