From f0829b841821542641f238702d18b99cc60fd9c8 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Tue, 16 Jul 2024 13:33:38 +1000 Subject: [PATCH] remove errConstraint logic --- backend/controller/dal/async_calls.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/controller/dal/async_calls.go b/backend/controller/dal/async_calls.go index 06f3d7a5ce..4046010fa2 100644 --- a/backend/controller/dal/async_calls.go +++ b/backend/controller/dal/async_calls.go @@ -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)