From 8fb9ea19a339acaefcabb44099db48109d32eeef Mon Sep 17 00:00:00 2001 From: Eric Allam Date: Sun, 24 Sep 2023 14:04:46 -0700 Subject: [PATCH] hotfix --- .../runs/performRunExecutionV2.server.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apps/webapp/app/services/runs/performRunExecutionV2.server.ts b/apps/webapp/app/services/runs/performRunExecutionV2.server.ts index e6ae5ad30..61feab018 100644 --- a/apps/webapp/app/services/runs/performRunExecutionV2.server.ts +++ b/apps/webapp/app/services/runs/performRunExecutionV2.server.ts @@ -153,6 +153,29 @@ export class PerformRunExecutionV2Service { return; } + try { + if ( + typeof process.env.BLOCKED_ORGS === "string" && + process.env.BLOCKED_ORGS.includes(run.organizationId) + ) { + logger.debug("Skipping execution for blocked org", { + orgId: run.organizationId, + }); + + await this.#prismaClient.jobRun.update({ + where: { + id: run.id, + }, + data: { + status: "CANCELED", + completedAt: new Date(), + }, + }); + + return; + } + } catch (e) {} + const client = new EndpointApi(run.environment.apiKey, run.endpoint.url); const event = eventRecordToApiJson(run.event);