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") {
|
||||
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()
|
||||
|
|
2
todo.md
2
todo.md
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue