Skip to content

Commit

Permalink
fix: Setup job-execution-sync-worker (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk authored Aug 30, 2024
1 parent 11f8875 commit d736211
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions apps/event-worker/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { logger } from "@ctrlplane/logger";

import { createDispatchExecutionJobWorker } from "./job-execution-dispatch/index.js";
import { createJobExecutionSyncWorker } from "./job-execution-sync/index.js";
import { redis } from "./redis.js";
import { createTargetScanWorker } from "./target-scan/index.js";

const targetScanWorker = createTargetScanWorker();
const jobExecutionSyncWorker = createJobExecutionSyncWorker();
const dispatchExecutionJobWorker = createDispatchExecutionJobWorker();

const shutdown = () => {
logger.warn("Exiting...");

targetScanWorker.close();
jobExecutionSyncWorker.close();
dispatchExecutionJobWorker.close();

redis.quit();

process.exit(0);
Expand Down
3 changes: 1 addition & 2 deletions apps/event-worker/src/job-execution-sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getSyncFunction = (agentType: string): SyncFunction | null => {
return null;
};

export const createJobExecutionSyncWorker = () => {
export const createJobExecutionSyncWorker = () =>
new Worker<DispatchJobExecutionEvent>(
Channel.JobExecutionSync,
(job) =>
Expand Down Expand Up @@ -62,4 +62,3 @@ export const createJobExecutionSyncWorker = () => {
concurrency: 10,
},
);
};

0 comments on commit d736211

Please sign in to comment.