diff --git a/server/src/commands.ts b/server/src/commands.ts index e652f7a66c..ad23bd6e97 100644 --- a/server/src/commands.ts +++ b/server/src/commands.ts @@ -151,6 +151,7 @@ function createJobAction(name) { name, queued, payload, + disallowPentest: false, }) if (exitCode) { diff --git a/server/src/jobs/jobs_actions.ts b/server/src/jobs/jobs_actions.ts index c532c95774..309c6ed733 100644 --- a/server/src/jobs/jobs_actions.ts +++ b/server/src/jobs/jobs_actions.ts @@ -15,15 +15,16 @@ import { runJob } from "./jobs" const logger = getLoggerWithContext("script") -type AddJobSimpleParams = Pick & Partial> & { queued?: boolean; productionOnly?: boolean } +type AddJobSimpleParams = Pick & + Partial> & { queued?: boolean; productionOnly?: boolean; disallowPentest?: boolean } -export async function addJob({ name, payload, scheduled_for = new Date(), queued = false, productionOnly = false }: AddJobSimpleParams): Promise { +export async function addJob({ name, payload, scheduled_for = new Date(), queued = false, productionOnly = false, disallowPentest = true }: AddJobSimpleParams): Promise { if (config.env !== "production" && productionOnly) { return 0 } // disable all jobs on pentest env - if (config.env === "pentest") { + if (config.env === "pentest" && disallowPentest) { return 0 }