Skip to content

Commit

Permalink
remove errConstraint logic
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jul 16, 2024
1 parent edd5d82 commit 0cd11c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backend/controller/dal/async_calls.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ func (d *DAL) AcquireAsyncCall(ctx context.Context) (call *AsyncCall, err error)
row, err := tx.db.AcquireAsyncCall(ctx, ttl)
if err != nil {
err = dalerrs.TranslatePGError(err)
// We get a NULL constraint violation if there are no async calls to acquire, so translate it to ErrNotFound.
if errors.Is(err, dalerrs.ErrConstraint) {
if errors.Is(err, dalerrs.ErrNotFound) {
return nil, fmt.Errorf("no pending async calls: %w", dalerrs.ErrNotFound)
}
return nil, fmt.Errorf("failed to acquire async call: %w", err)
Expand Down

0 comments on commit 0cd11c6

Please sign in to comment.