dbjobqueue: Reduce error noise in rollback check
If the transaction is already closed don't log the rollback failure as an error, it means it was successfully committed.
This commit is contained in:
parent
810248fc52
commit
9fab5def90
1 changed files with 3 additions and 3 deletions
|
|
@ -115,7 +115,7 @@ func (q *dbJobQueue) Enqueue(jobType string, args interface{}, dependencies []uu
|
|||
}
|
||||
defer func() {
|
||||
err := tx.Rollback(context.Background())
|
||||
if err != nil {
|
||||
if err != nil && !errors.As(err, &pgx.ErrTxClosed) {
|
||||
log.Println("error rolling back enqueue transaction: ", err)
|
||||
}
|
||||
}()
|
||||
|
|
@ -214,8 +214,8 @@ func (q *dbJobQueue) FinishJob(id uuid.UUID, result interface{}) error {
|
|||
}
|
||||
defer func() {
|
||||
err = tx.Rollback(context.Background())
|
||||
if err != nil {
|
||||
log.Println("error rolling back enqueue transaction: ", err)
|
||||
if err != nil && !errors.As(err, &pgx.ErrTxClosed) {
|
||||
log.Println("error rolling back finish job transaction: ", err)
|
||||
}
|
||||
|
||||
}()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue