You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-11-27 00:20:27 +02:00
skip wrapping sql.ErrNoRows
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user