Skip to content

Commit 3ae0165

Browse files
fix: Only dispatch from new engine in dev
1 parent 3c61a6f commit 3ae0165

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/event-worker/src/workers/policy-evaluate.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { env } from "process";
2+
13
import { and, desc, eq, inArray, takeFirstOrNull } from "@ctrlplane/db";
24
import { db } from "@ctrlplane/db/client";
35
import * as schema from "@ctrlplane/db/schema";
@@ -116,7 +118,8 @@ export const policyEvaluateWorker = createWorker(
116118
return;
117119
}
118120

119-
getQueue(Channel.DispatchJob).add(dbJob.id, { jobId: dbJob.id });
121+
if (env.NODE_ENV === "development")
122+
getQueue(Channel.DispatchJob).add(dbJob.id, { jobId: dbJob.id });
120123
} finally {
121124
await mutex.unlock();
122125
}

0 commit comments

Comments
 (0)