Skip to content

Commit eab9094

Browse files
committed
imp(limiter): do not count events for blocked workspaces
1 parent 9202a55 commit eab9094

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+
* If workspace is already blocked - do nothing
187+
*/
188+
if (workspace.isBlocked) {
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)