added proper error handling of db prune cron

This commit is contained in:
BroodjeAap 2022-12-21 21:36:30 +00:00
parent 1aff350e02
commit 9db84fdce9
2 changed files with 4 additions and 3 deletions

View file

@ -146,7 +146,10 @@ func (web *Web) initCronJobs() {
}
if viper.IsSet("database.prune") {
pruneSchedule := viper.GetString("database.prune")
web.cron.AddFunc(pruneSchedule, web.pruneDB)
_, err := web.cron.AddFunc(pruneSchedule, web.pruneDB)
if err != nil {
log.Fatalln("Could not parse database.prune:", pruneSchedule)
}
log.Println("Started DB prune cronjob:", pruneSchedule)
}
web.cron.Start()

View file

@ -11,8 +11,6 @@
- log things to db for cron runs
- comments
- set default value for database.dns
- proper handling of errors in prune schedule
- add <title>
- add unique filter
- provide template/example watches?
- Amazon