1
1
import { createRedisClient , Redis } from "@internal/redis" ;
2
- import { Worker } from "@trigger.dev/redis-worker" ;
3
2
import { startSpan , trace , Tracer } from "@internal/tracing" ;
4
3
import { Logger } from "@trigger.dev/core/logger" ;
5
4
import {
@@ -13,7 +12,7 @@ import {
13
12
StartRunAttemptResult ,
14
13
TaskRunExecutionResult ,
15
14
} 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" ;
17
16
import {
18
17
Prisma ,
19
18
PrismaClient ,
@@ -22,6 +21,7 @@ import {
22
21
TaskRunExecutionSnapshot ,
23
22
Waitpoint ,
24
23
} from "@trigger.dev/database" ;
24
+ import { Worker } from "@trigger.dev/redis-worker" ;
25
25
import { assertNever } from "assert-never" ;
26
26
import { EventEmitter } from "node:events" ;
27
27
import { FairQueueSelectionStrategy } from "../run-queue/fairQueueSelectionStrategy.js" ;
@@ -44,11 +44,11 @@ import {
44
44
ExecutionSnapshotSystem ,
45
45
getLatestExecutionSnapshot ,
46
46
} from "./systems/executionSnapshotSystem.js" ;
47
+ import { PendingVersionSystem } from "./systems/pendingVersionSystem.js" ;
47
48
import { ReleaseConcurrencySystem } from "./systems/releaseConcurrencySystem.js" ;
48
49
import { RunAttemptSystem } from "./systems/runAttemptSystem.js" ;
49
50
import { SystemResources } from "./systems/systems.js" ;
50
51
import { TtlSystem } from "./systems/ttlSystem.js" ;
51
- import { PendingVersionSystem } from "./systems/pendingVersionSystem.js" ;
52
52
import { WaitpointSystem } from "./systems/waitpointSystem.js" ;
53
53
import { EngineWorker , HeartbeatTimeouts , RunEngineOptions , TriggerParams } from "./types.js" ;
54
54
import { workerCatalog } from "./workerCatalog.js" ;
@@ -165,7 +165,11 @@ export class RunEngine {
165
165
await this . delayedRunSystem . enqueueDelayedRun ( { runId : payload . runId } ) ;
166
166
} ,
167
167
} ,
168
- } ) . start ( ) ;
168
+ } ) ;
169
+
170
+ if ( ! options . worker . disabled ) {
171
+ this . worker . start ( ) ;
172
+ }
169
173
170
174
this . tracer = options . tracer ;
171
175
0 commit comments