Improve 'tries' naming scheme and implement exponential retry delay with jitter
This commit is contained in:
@@ -6,6 +6,7 @@ import { Type as t } from "@sinclair/typebox";
|
||||
import { Value } from "@sinclair/typebox/value";
|
||||
import { sql } from "kysely";
|
||||
import zipcodesUs from "zipcodes-us";
|
||||
import { minToMs, secToMs } from "@blade-and-brawn/domain";
|
||||
|
||||
export class CommerceService {
|
||||
readonly Printful = new PrintfulClient({
|
||||
@@ -37,8 +38,8 @@ class ApparelOrdersService {
|
||||
this.Queue = new EventQueue({
|
||||
group: "apparel_order",
|
||||
cfg: {
|
||||
retry: { limit: 3, delayMs: 10000 },
|
||||
concurrency: { limit: 1, timeoutMs: 600000 }
|
||||
error: { limit: 3, initialRetryDelayMs: secToMs(1) },
|
||||
concurrency: { limit: 1, timeoutMs: minToMs(10) }
|
||||
},
|
||||
events: {
|
||||
"apparel_order_create": defineEventType({
|
||||
@@ -105,8 +106,8 @@ class ApparelSyncService {
|
||||
this.Queue = new EventQueue({
|
||||
group: "apparel_sync",
|
||||
cfg: {
|
||||
retry: { limit: 3, delayMs: 10000 },
|
||||
concurrency: { limit: 1, timeoutMs: 600000 }
|
||||
error: { limit: 3, initialRetryDelayMs: secToMs(1) },
|
||||
concurrency: { limit: 1, timeoutMs: minToMs(10) }
|
||||
},
|
||||
events: {
|
||||
"apparel_sync_update": defineEventType({
|
||||
|
||||
Reference in New Issue
Block a user