Skip to content

Commit 7fae67c

Browse files
authored
Fix/autoyield canceled run (#890)
* Todo for the fix * If the run has been canceled during execution, don’t do any further processing of the run
1 parent 9ae0ca6 commit 7fae67c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

apps/webapp/app/services/runs/performRunExecutionV3.server.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,19 @@ export class PerformRunExecutionV3Service {
207207

208208
forceYieldCoordinator.deregisterRun(run.id);
209209

210+
//if the run has been canceled while it's being executed, we shouldn't do anything more
211+
const updatedRun = await this.#prismaClient.jobRun.findUnique({
212+
select: {
213+
status: true,
214+
},
215+
where: {
216+
id: run.id,
217+
},
218+
});
219+
if (!updatedRun || updatedRun.status === "CANCELED") {
220+
return;
221+
}
222+
210223
if (!response) {
211224
return await this.#failRunExecutionWithRetry(
212225
run,

0 commit comments

Comments
 (0)