mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +00:00
26 lines
516 B
TypeScript
26 lines
516 B
TypeScript
import { BasePlan } from "../swr/use-billing";
|
|
|
|
type TQueueConfig = {
|
|
name: string;
|
|
concurrencyLimit: number;
|
|
};
|
|
|
|
const concurrencyConfig: Record<string, number> = {
|
|
free: 1,
|
|
starter: 1,
|
|
pro: 2,
|
|
business: 10,
|
|
datarooms: 10,
|
|
"datarooms-plus": 10,
|
|
"datarooms-premium": 10,
|
|
};
|
|
|
|
export const conversionQueue = (plan: string): TQueueConfig => {
|
|
const planName = plan.split("+")[0] as BasePlan;
|
|
|
|
return {
|
|
name: `conversion-${planName}`,
|
|
concurrencyLimit: concurrencyConfig[planName],
|
|
};
|
|
};
|