Skip to content

Commit

Permalink
Retry on all SQLITE_BUSY error codes (#1917)
Browse files Browse the repository at this point in the history
retry on all sqlite_busy error codes
  • Loading branch information
devinivy authored Dec 4, 2023
1 parent 8683c92 commit ff50319
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/pds/src/db/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ const getWaitMsSqlite = (n: number, timeout = 5000) => {
const last = <T>(arr: T[]) => arr[arr.length - 1]
const DELAYS = [1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100]
const TOTALS = [0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228]
const RETRY_ERRORS = new Set(['SQLITE_BUSY', 'SQLITE_BUSY_SNAPSHOT'])
const RETRY_ERRORS = new Set([
'SQLITE_BUSY',
'SQLITE_BUSY_SNAPSHOT',
'SQLITE_BUSY_RECOVERY',
'SQLITE_BUSY_TIMEOUT',
])

export type Ref = ReferenceExpression<any, any>

Expand Down

0 comments on commit ff50319

Please sign in to comment.