Improve 'tries' naming scheme and implement exponential retry delay with jitter

This commit is contained in:
Dominic Ferrando
2026-07-15 15:37:40 -04:00
parent fd94f22d21
commit 67886d0f6c
3 changed files with 38 additions and 21 deletions
@@ -13,7 +13,7 @@ export async function up(db: Kysely<any>): Promise<void> {
.addColumn("started_at", "timestamptz")
.addColumn("ended_at", "timestamptz")
.addColumn("available_at", "timestamptz", (cb) => cb.notNull().defaultTo(sql`now()`))
.addColumn("tries", "integer", (cb) => cb.notNull().defaultTo(0))
.addColumn("errors", "integer", (cb) => cb.notNull().defaultTo(0))
.addColumn("rate_limits", "integer", (cb) => cb.notNull().defaultTo(0))
.addColumn("has_failed", "boolean", (cb) => cb.notNull().defaultTo(false))
.execute()