@@ -10,6 +10,7 @@ import { RunEngineOptions } from "../types.js";
1010import { ExecutionSnapshotSystem , getLatestExecutionSnapshot } from "./executionSnapshotSystem.js" ;
1111import { RunAttemptSystem } from "./runAttemptSystem.js" ;
1212import { SystemResources } from "./systems.js" ;
13+ import { sendNotificationToWorker } from "../eventBus.js" ;
1314
1415export type DequeueSystemOptions = {
1516 resources : SystemResources ;
@@ -128,6 +129,38 @@ export class DequeueSystem {
128129 return null ;
129130 }
130131
132+ if ( snapshot . executionStatus === "QUEUED_EXECUTING" ) {
133+ const newSnapshot = await this . executionSnapshotSystem . createExecutionSnapshot (
134+ prisma ,
135+ {
136+ run : {
137+ id : runId ,
138+ status : snapshot . runStatus ,
139+ attemptNumber : snapshot . attemptNumber ,
140+ } ,
141+ snapshot : {
142+ executionStatus : "EXECUTING" ,
143+ description : "Run was continued, whilst still executing." ,
144+ } ,
145+ environmentId : snapshot . environmentId ,
146+ environmentType : snapshot . environmentType ,
147+ batchId : snapshot . batchId ?? undefined ,
148+ completedWaitpoints : snapshot . completedWaitpoints . map ( ( waitpoint ) => ( {
149+ id : waitpoint . id ,
150+ index : waitpoint . index ,
151+ } ) ) ,
152+ }
153+ ) ;
154+
155+ await sendNotificationToWorker ( {
156+ runId,
157+ snapshot : newSnapshot ,
158+ eventBus : this . $ . eventBus ,
159+ } ) ;
160+
161+ return null ;
162+ }
163+
131164 const result = await getRunWithBackgroundWorkerTasks (
132165 prisma ,
133166 runId ,
0 commit comments