Skip to content

Commit abd99aa

Browse files
authored
Don't show (or count) archived branches/projects against allocated concurrency (#2698)
Archived preview branches were being counted. Also archived projects.
1 parent 4347499 commit abd99aa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/webapp/app/presenters/v3/ManageConcurrencyPresenter.server.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,15 @@ export class ManageConcurrencyPresenter extends BasePresenter {
6363
userId: true,
6464
},
6565
},
66+
project: {
67+
select: {
68+
deletedAt: true,
69+
},
70+
},
6671
},
6772
where: {
6873
organizationId,
74+
archivedAt: null,
6975
},
7076
});
7177

@@ -78,6 +84,9 @@ export class ManageConcurrencyPresenter extends BasePresenter {
7884
// Don't count parent environments
7985
if (environment.isBranchableEnvironment) continue;
8086

87+
// Don't count deleted projects
88+
if (environment.project.deletedAt) continue;
89+
8190
const limit = currentPlan
8291
? getDefaultEnvironmentLimitFromPlan(environment.type, currentPlan)
8392
: 0;

0 commit comments

Comments
 (0)