added proper error handling of db prune cron
This commit is contained in:
parent
1aff350e02
commit
9db84fdce9
2 changed files with 4 additions and 3 deletions
5
main.go
5
main.go
|
@ -146,7 +146,10 @@ func (web *Web) initCronJobs() {
|
||||||
}
|
}
|
||||||
if viper.IsSet("database.prune") {
|
if viper.IsSet("database.prune") {
|
||||||
pruneSchedule := viper.GetString("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)
|
log.Println("Started DB prune cronjob:", pruneSchedule)
|
||||||
}
|
}
|
||||||
web.cron.Start()
|
web.cron.Start()
|
||||||
|
|
2
todo.md
2
todo.md
|
@ -11,8 +11,6 @@
|
||||||
- log things to db for cron runs
|
- log things to db for cron runs
|
||||||
- comments
|
- comments
|
||||||
- set default value for database.dns
|
- set default value for database.dns
|
||||||
- proper handling of errors in prune schedule
|
|
||||||
- add <title>
|
|
||||||
- add unique filter
|
- add unique filter
|
||||||
- provide template/example watches?
|
- provide template/example watches?
|
||||||
- Amazon
|
- Amazon
|
||||||
|
|
Loading…
Add table
Reference in a new issue