File tree Expand file tree Collapse file tree
internal-packages/run-engine/src/engine/systems Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ export class DelayedRunSystem {
121121 const env = await this . $ . controlPlaneResolver . resolveEnv ( run . runtimeEnvironmentId ) ;
122122
123123 if ( ! env ) {
124- throw new Error ( `#enqueueDelayedRun: run not found: ${ runId } ` ) ;
124+ throw new Error ( `#enqueueDelayedRun: environment not found for run : ${ runId } ` ) ;
125125 }
126126
127127 // Check if delayUntil has been rescheduled to the future (e.g., by debounce)
Original file line number Diff line number Diff line change @@ -772,6 +772,7 @@ export class DequeueSystem {
772772
773773 if ( ! env ) {
774774 this . $ . logger . error ( "RunEngine.#pendingVersion(): environment not found" , { runId } ) ;
775+ await this . $ . runQueue . acknowledgeMessage ( orgId , runId ) ;
775776 return ;
776777 }
777778
Original file line number Diff line number Diff line change @@ -101,16 +101,7 @@ export class TtlSystem {
101101 prisma
102102 ) ;
103103
104- const env = await this . $ . controlPlaneResolver . resolveEnv ( updatedRun . runtimeEnvironmentId ) ;
105-
106- if ( ! env ) {
107- this . $ . logger . debug ( "Run cannot be expired because its environment was not found" , {
108- runId,
109- } ) ;
110- return ;
111- }
112-
113- await this . $ . runQueue . acknowledgeMessage ( env . organizationId , runId , {
104+ await this . $ . runQueue . acknowledgeMessage ( snapshot . organizationId , runId , {
114105 removeFromWorkerQueue : true ,
115106 } ) ;
116107
@@ -125,9 +116,9 @@ export class TtlSystem {
125116 this . $ . eventBus . emit ( "runExpired" , {
126117 run : updatedRun ,
127118 time : new Date ( ) ,
128- organization : { id : env . organizationId } ,
129- project : { id : env . projectId } ,
130- environment : { id : env . id } ,
119+ organization : { id : snapshot . organizationId } ,
120+ project : { id : snapshot . projectId } ,
121+ environment : { id : snapshot . environmentId } ,
131122 } ) ;
132123 } ) ;
133124 }
Original file line number Diff line number Diff line change @@ -739,7 +739,9 @@ export class WaitpointSystem {
739739 runId,
740740 runtimeEnvironmentId : run . runtimeEnvironmentId ,
741741 } ) ;
742- throw new Error ( `continueRunIfUnblocked: run not found: ${ runId } ` ) ;
742+ throw new Error (
743+ `continueRunIfUnblocked: environment not found: ${ run . runtimeEnvironmentId } `
744+ ) ;
743745 }
744746
745747 //4. Continue the run whether it's executing or not
You can’t perform that action at this time.
0 commit comments