Skip to content

Commit 83961aa

Browse files
committed
imp(limiter): do not count events for already blocked workspaces
1 parent 4fc742a commit 83961aa

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

workers/limiter/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ export default class LimiterWorker extends Worker {
182182
const updatedWorkspaces: WorkspaceWithTariffPlan[] = [];
183183

184184
await Promise.all(workspaces.map(async (workspace) => {
185+
/**
186+
* Skip if workspace is already blocked
187+
*/
188+
if (workspace.isBlocked === true) {
189+
return;
190+
}
191+
185192
const workspaceProjects = await this.dbHelper.getProjects(workspace._id.toString());
186193

187194
const { shouldBeBlockedByQuota, updatedWorkspace, projectsToUpdate } = await this.prepareWorkspaceUsageUpdate(workspace, workspaceProjects);

0 commit comments

Comments
 (0)