Don't fail to process background jobs because one failed
This commit is contained in:
parent
ac552be7e7
commit
abbe80b1f0
1 changed files with 3 additions and 3 deletions
|
|
@ -90,18 +90,18 @@ func addWaitingJobs(ctx context.Context) error {
|
|||
txn, err := db.PGInstance.BobDB.Begin(ctx)
|
||||
if err != nil {
|
||||
sublog.Error().Err(err).Msg("failed begin txn")
|
||||
return
|
||||
continue
|
||||
}
|
||||
defer txn.Rollback(ctx)
|
||||
err = handleJob(ctx, txn, job)
|
||||
if err != nil {
|
||||
sublog.Error().Err(err).Msg("failed handle job")
|
||||
return
|
||||
continue
|
||||
}
|
||||
err = job.Delete(ctx, txn)
|
||||
if err != nil {
|
||||
sublog.Error().Err(err).Msg("failed delete job")
|
||||
return
|
||||
continue
|
||||
}
|
||||
sublog.Info().Msg("job complete")
|
||||
txn.Commit(ctx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue