feat(core): Expand crash recovery to cover queue mode (#9676)
This commit is contained in:
@@ -275,9 +275,7 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
||||
},
|
||||
);
|
||||
|
||||
this.logger.info('[Execution Recovery] Marked executions as `crashed`', {
|
||||
executionIds,
|
||||
});
|
||||
this.logger.info('Marked executions as `crashed`', { executionIds });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -773,4 +771,18 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
||||
|
||||
return executions.map(({ id }) => id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a batch of execution IDs with `new` or `running` status, in most recent order.
|
||||
*/
|
||||
async getInProgressExecutionIds(batchSize: number) {
|
||||
const executions = await this.find({
|
||||
select: ['id'],
|
||||
where: { status: In(['new', 'running']) },
|
||||
order: { startedAt: 'DESC' },
|
||||
take: batchSize,
|
||||
});
|
||||
|
||||
return executions.map(({ id }) => id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user