Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update backfill-workspace-groups-limit.ts

Kiran K83c9dcb5b58e
diff --git a/apps/web/scripts/partners/backfill-workspace-groups-limit.ts b/apps/web/scripts/partners/backfill-workspace-groups-limit.ts
index b12ceee0bb..cf4f11f767 100644
--- a/apps/web/scripts/partners/backfill-workspace-groups-limit.ts
+++ b/apps/web/scripts/partners/backfill-workspace-groups-limit.ts
@@ -27,22 +27,20 @@ async function main() {
console.table(workspaces);
console.log(`Found ${workspaces.length} workspaces to update.`);
- for (const workspace of workspaces) {
- const plan = getCurrentPlan(workspace.plan);
+ await Promise.allSettled(
+ workspaces.map((workspace) => {
+ const plan = getCurrentPlan(workspace.plan);
- await prisma.project.update({
- where: {
- id: workspace.id,
- },
- data: {
- groupsLimit: plan.limits.groups!,
- },
- });
-
- console.log(
- `Updated ${workspace.slug} groups limit to ${plan.limits.groups}`,
- );
- }
+ return prisma.project.update({
+ where: {
+ id: workspace.id,
+ },
+ data: {
+ groupsLimit: plan.limits.groups!,
+ },
+ });
+ }),
+ );
}
main();