The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Reduce subscription quantity sync delay from 24h to 6h (#26190)
Etienne7dfc431afd0f
diff --git a/packages/twenty-server/src/engine/core-modules/billing/constants/update-subscription-quantity-job-delay-ms.constant.ts b/packages/twenty-server/src/engine/core-modules/billing/constants/update-subscription-quantity-job-delay-ms.constant.tsindex 3bc0b2c43f7..ac86deb7c08 100644--- a/packages/twenty-server/src/engine/core-modules/billing/constants/update-subscription-quantity-job-delay-ms.constant.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/constants/update-subscription-quantity-job-delay-ms.constant.ts@@ -1 +1 @@-export const UPDATE_SUBSCRIPTION_QUANTITY_JOB_DELAY_MS = 24 * 60 * 60 * 1000;+export const UPDATE_SUBSCRIPTION_QUANTITY_JOB_DELAY_MS = 6 * 60 * 60 * 1000;diff --git a/packages/twenty-server/src/engine/core-modules/billing/listeners/billing-workspace-member.listener.ts b/packages/twenty-server/src/engine/core-modules/billing/listeners/billing-workspace-member.listener.tsindex 3ef394a0f87..efd74b66a75 100644--- a/packages/twenty-server/src/engine/core-modules/billing/listeners/billing-workspace-member.listener.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/listeners/billing-workspace-member.listener.ts@@ -37,7 +37,7 @@ export class BillingWorkspaceMemberListener {if (!this.twentyConfigService.get('IS_BILLING_ENABLED')) {return;}- // The 24h delay is a settling window: upgrade/churn during the day coalesces+ // The 6h delay is a settling window: upgrade/churn within the window coalesces// into one net update (count is read at run time), so transient member changes// don't each generate a new Stripe invoice.await this.messageQueueService.add<UpdateSubscriptionQuantityJobData>(