skip wrapping sql.ErrNoRows
This commit is contained in:
parent
cdfc1f7b70
commit
14a2fd6215
|
@ -2,6 +2,8 @@ package daos
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"database/sql"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -27,11 +29,11 @@ func execLockRetry(timeout time.Duration, maxRetries int) dbx.ExecHookFunc {
|
||||||
execErr := baseLockRetry(func(attempt int) error {
|
execErr := baseLockRetry(func(attempt int) error {
|
||||||
return op()
|
return op()
|
||||||
}, maxRetries)
|
}, maxRetries)
|
||||||
if execErr != nil {
|
if execErr != nil && !errors.Is(execErr, sql.ErrNoRows) {
|
||||||
return fmt.Errorf("%w; failed query: %s", execErr, q.SQL())
|
execErr = fmt.Errorf("%w; failed query: %s", execErr, q.SQL())
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return execErr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue