fix:#150 update frontend deps and schedule

This commit is contained in:
Elmar Kresse
2024-01-21 18:33:01 +01:00
parent 25d2a5ae31
commit 23c9794c10
3 changed files with 1273 additions and 489 deletions

View File

@@ -11,8 +11,8 @@ import (
v2 "htwkalender/service/fetch/v2"
"htwkalender/service/functions/time"
"log"
"strconv"
"log/slog"
"strconv"
)
func AddSchedules(app *pocketbase.PocketBase) {
@@ -35,10 +35,8 @@ func AddSchedules(app *pocketbase.PocketBase) {
feed.ClearFeeds(app.Dao(), 6, time.RealClock{})
})
// 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() {
// 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() {
scheduler.MustAdd("fetchSportEvents", "0 3 * * 0", func() {
slog.Info("Started fetching sport events schedule")
sport.FetchAndUpdateSportEvents(app)
})
@@ -50,7 +48,7 @@ func AddSchedules(app *pocketbase.PocketBase) {
log.Println(err)
}
err, savedEvents := v2.FetchAllEventsAndSave(app)
savedEvents, err := v2.FetchAllEventsAndSave(app, time.RealClock{})
if err != nil {
log.Println(err)
} else {