mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
fix: Add accurate concurrent executions count to executions list (#19249)
This commit is contained in:
@@ -59,20 +59,32 @@ export class ExecutionsController {
|
||||
const noRange = !query.range.lastId || !query.range.firstId;
|
||||
|
||||
if (noStatus && noRange) {
|
||||
const executions = await this.executionService.findLatestCurrentAndCompleted(query);
|
||||
const [executions, concurrentExecutionsCount] = await Promise.all([
|
||||
this.executionService.findLatestCurrentAndCompleted(query),
|
||||
this.executionService.getConcurrentExecutionsCount(),
|
||||
]);
|
||||
await this.executionService.addScopes(
|
||||
req.user,
|
||||
executions.results as ExecutionSummaries.ExecutionSummaryWithScopes[],
|
||||
);
|
||||
return executions;
|
||||
return {
|
||||
...executions,
|
||||
concurrentExecutionsCount,
|
||||
};
|
||||
}
|
||||
|
||||
const executions = await this.executionService.findRangeWithCount(query);
|
||||
const [executions, concurrentExecutionsCount] = await Promise.all([
|
||||
this.executionService.findRangeWithCount(query),
|
||||
this.executionService.getConcurrentExecutionsCount(),
|
||||
]);
|
||||
await this.executionService.addScopes(
|
||||
req.user,
|
||||
executions.results as ExecutionSummaries.ExecutionSummaryWithScopes[],
|
||||
);
|
||||
return executions;
|
||||
return {
|
||||
...executions,
|
||||
concurrentExecutionsCount,
|
||||
};
|
||||
}
|
||||
|
||||
@Get('/:id')
|
||||
|
||||
Reference in New Issue
Block a user