From 51e0dfde235371103033e00a1de662b66a03e1ff Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 10 Aug 2023 09:43:40 +0800 Subject: [PATCH] set new limit = 1500 --- packages/api/src/services/features.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/api/src/services/features.ts b/packages/api/src/services/features.ts index 70157e516..c6ca41c7f 100644 --- a/packages/api/src/services/features.ts +++ b/packages/api/src/services/features.ts @@ -40,16 +40,17 @@ const optInUltraRealisticVoice = async (uid: string): Promise => { return feature } - // opt in to feature for the first 1000 users + const MAX_USERS = 1500 + // opt in to feature for the first 1500 users const newFeatures = (await AppDataSource.query( `insert into omnivore.features (user_id, name, granted_at) select $1, $2, $3 from omnivore.features where name = $2 and granted_at is not null - having count(*) < 1000 + having count(*) < $4 on conflict (user_id, name) do update set granted_at = $3 returning *, granted_at as "grantedAt", created_at as "createdAt", updated_at as "updatedAt";`, - [uid, FeatureName.UltraRealisticVoice, new Date()] + [uid, FeatureName.UltraRealisticVoice, new Date(), MAX_USERS] )) as Feature[] // if no new features were created then user has exceeded max users