Skip to content

Commit bf040ca

Browse files
authored
Merge branch 'main' into frameworks/astro
2 parents f7f9f4f + 8b25e57 commit bf040ca

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

apps/webapp/app/models/organization.server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ export async function createOrganization(
7676
},
7777
attemptCount = 0
7878
): Promise<Organization & { projects: Project[] }> {
79+
if (typeof process.env.BLOCKED_USERS === "string" && process.env.BLOCKED_USERS.includes(userId)) {
80+
throw new Error("Organization could not be created.");
81+
}
82+
7983
const uniqueOrgSlug = `${slug(title)}-${nanoid(4)}`;
8084

8185
const orgWithSameSlug = await prisma.organization.findFirst({

apps/webapp/app/services/runs/performRunExecutionV2.server.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,29 @@ export class PerformRunExecutionV2Service {
153153
return;
154154
}
155155

156+
try {
157+
if (
158+
typeof process.env.BLOCKED_ORGS === "string" &&
159+
process.env.BLOCKED_ORGS.includes(run.organizationId)
160+
) {
161+
logger.debug("Skipping execution for blocked org", {
162+
orgId: run.organizationId,
163+
});
164+
165+
await this.#prismaClient.jobRun.update({
166+
where: {
167+
id: run.id,
168+
},
169+
data: {
170+
status: "CANCELED",
171+
completedAt: new Date(),
172+
},
173+
});
174+
175+
return;
176+
}
177+
} catch (e) {}
178+
156179
const client = new EndpointApi(run.environment.apiKey, run.endpoint.url);
157180
const event = eventRecordToApiJson(run.event);
158181

0 commit comments

Comments
 (0)