From f9827b2151a698da1734834d2c8c2e7b302e4f35 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 30 Jul 2024 19:13:17 -0400 Subject: [PATCH] Update credit_billing.ts --- apps/api/src/services/billing/credit_billing.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.ts index b39c42c2..765d028e 100644 --- a/apps/api/src/services/billing/credit_billing.ts +++ b/apps/api/src/services/billing/credit_billing.ts @@ -6,6 +6,7 @@ import { Logger } from "../../lib/logger"; import { getValue, setValue } from "../redis"; import Redlock from "redlock"; import Client from "ioredis"; + const FREE_CREDITS = 500; const redlock = new Redlock( @@ -19,10 +20,10 @@ const redlock = new Redlock( // The max number of times Redlock will attempt to lock a resource // before erroring. - retryCount: 10, + retryCount: 5, // the time in ms between attempts - retryDelay: 200, // time in ms + retryDelay: 100, // time in ms // the max time in ms randomly added to retries // to improve performance under high contention