11import { createRedisClient , Redis } from "@internal/redis" ;
2- import { Worker } from "@trigger.dev/redis-worker" ;
32import { startSpan , trace , Tracer } from "@internal/tracing" ;
43import { Logger } from "@trigger.dev/core/logger" ;
54import {
@@ -13,7 +12,7 @@ import {
1312 StartRunAttemptResult ,
1413 TaskRunExecutionResult ,
1514} from "@trigger.dev/core/v3" ;
16- import { BatchId , QueueId , RunId , WaitpointId } from "@trigger.dev/core/v3/isomorphic" ;
15+ import { BatchId , RunId , WaitpointId } from "@trigger.dev/core/v3/isomorphic" ;
1716import {
1817 Prisma ,
1918 PrismaClient ,
@@ -22,6 +21,7 @@ import {
2221 TaskRunExecutionSnapshot ,
2322 Waitpoint ,
2423} from "@trigger.dev/database" ;
24+ import { Worker } from "@trigger.dev/redis-worker" ;
2525import { assertNever } from "assert-never" ;
2626import { EventEmitter } from "node:events" ;
2727import { FairQueueSelectionStrategy } from "../run-queue/fairQueueSelectionStrategy.js" ;
@@ -44,11 +44,11 @@ import {
4444 ExecutionSnapshotSystem ,
4545 getLatestExecutionSnapshot ,
4646} from "./systems/executionSnapshotSystem.js" ;
47+ import { PendingVersionSystem } from "./systems/pendingVersionSystem.js" ;
4748import { ReleaseConcurrencySystem } from "./systems/releaseConcurrencySystem.js" ;
4849import { RunAttemptSystem } from "./systems/runAttemptSystem.js" ;
4950import { SystemResources } from "./systems/systems.js" ;
5051import { TtlSystem } from "./systems/ttlSystem.js" ;
51- import { PendingVersionSystem } from "./systems/pendingVersionSystem.js" ;
5252import { WaitpointSystem } from "./systems/waitpointSystem.js" ;
5353import { EngineWorker , HeartbeatTimeouts , RunEngineOptions , TriggerParams } from "./types.js" ;
5454import { workerCatalog } from "./workerCatalog.js" ;
@@ -165,7 +165,11 @@ export class RunEngine {
165165 await this . delayedRunSystem . enqueueDelayedRun ( { runId : payload . runId } ) ;
166166 } ,
167167 } ,
168- } ) . start ( ) ;
168+ } ) ;
169+
170+ if ( ! options . worker . disabled ) {
171+ this . worker . start ( ) ;
172+ }
169173
170174 this . tracer = options . tracer ;
171175
0 commit comments