diff --git a/server/src/index.ts b/server/src/index.ts index e04040d4d..569c8d88c 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -150,7 +150,7 @@ if (process.env.NODE_ENV === "development") { console.log(`Master ${process.pid} is running`); console.log("Number of CPUs", numCPUs); - let numWorkers = 8; + let numWorkers = 10; for (let i = 0; i < numWorkers; i++) { cluster.fork(); diff --git a/server/src/internal/customers/attach/attachFunctions/scheduleFlow/scheduleStripeSub.ts b/server/src/internal/customers/attach/attachFunctions/scheduleFlow/scheduleStripeSub.ts index a64f95523..7e275adc6 100644 --- a/server/src/internal/customers/attach/attachFunctions/scheduleFlow/scheduleStripeSub.ts +++ b/server/src/internal/customers/attach/attachFunctions/scheduleFlow/scheduleStripeSub.ts @@ -81,7 +81,7 @@ export const updateOtherCusProdsWithNewSchedule = async ({ }) => { const otherCusProducts = getCusProductsWithStripeSubId({ cusProducts: attachParams.cusProducts!, - stripeSubId: otherSub.id, + stripeSubId: otherSub?.id, }); if (otherCusProducts.length > 0) { diff --git a/server/tests/attach/upgrade/upgrade3.ts b/server/tests/attach/upgrade/upgrade3.ts index 91b2b39d0..3a23b979b 100644 --- a/server/tests/attach/upgrade/upgrade3.ts +++ b/server/tests/attach/upgrade/upgrade3.ts @@ -109,12 +109,12 @@ describe(`${chalk.yellowBright(`${testCase}: Testing upgrades with arrear prorat { id: "entity1", name: "entity1", - featureId: TestFeature.Users, + feature_id: TestFeature.Users, }, { id: "entity2", name: "entity2", - featureId: TestFeature.Users, + feature_id: TestFeature.Users, }, ]); numUsers = 2; @@ -148,7 +148,7 @@ describe(`${chalk.yellowBright(`${testCase}: Testing upgrades with arrear prorat { id: "entity3", name: "entity3", - featureId: TestFeature.Users, + feature_id: TestFeature.Users, }, ]); numUsers += 1; diff --git a/server/tests/global.ts b/server/tests/global.ts index 2aca93eb3..85e5e9e77 100644 --- a/server/tests/global.ts +++ b/server/tests/global.ts @@ -26,6 +26,7 @@ import { import { createSupabaseClient } from "@/external/supabaseUtils.js"; import { OrgService } from "@/internal/orgs/OrgService.js"; import { initDrizzle } from "@/db/initDrizzle.js"; +import { FeatureService } from "@/internal/features/FeatureService.js"; export const features: Record = { boolean1: initFeature({ @@ -863,11 +864,11 @@ before(async function () { slug: ORG_SLUG, }); - let { data: dbFeatures, error } = await this.sb - .from("features") - .select("*") - .eq("org_id", this.org.id) - .eq("env", this.env); + const dbFeatures = await FeatureService.list({ + db: this.db, + orgId: this.org.id, + env: this.env, + }); const cleanFeatures = (features: Record) => { for (const featureId in features) {