refactor: Async functions don't need to explicitly return promises (no-changelog) (#6041)
This commit is contained in:
committed by
GitHub
parent
03be725cef
commit
308a94311f
@@ -527,15 +527,12 @@ export default mixins(externalHooks, genericHelpers, executionHelpers, showMessa
|
||||
// Suppose 504 finishes before 500, 501, 502 and 503.
|
||||
// iF you use firstId, filtering id >= 504 you won't
|
||||
// ever get ids 500, 501, 502 and 503 when they finish
|
||||
const pastExecutionsPromise: Promise<IExecutionsListResponse> =
|
||||
this.workflowsStore.getPastExecutions(filter, this.requestItemsPerRequest);
|
||||
const currentExecutionsPromise: Promise<IExecutionsCurrentSummaryExtended[]> = isEmpty(
|
||||
filter.metadata,
|
||||
)
|
||||
? this.workflowsStore.getCurrentExecutions({})
|
||||
: Promise.resolve([]);
|
||||
const promises = [this.workflowsStore.getPastExecutions(filter, this.requestItemsPerRequest)];
|
||||
if (isEmpty(filter.metadata)) {
|
||||
promises.push(this.workflowsStore.getCurrentExecutions({}));
|
||||
}
|
||||
|
||||
const results = await Promise.all([pastExecutionsPromise, currentExecutionsPromise]);
|
||||
const results = await Promise.all(promises);
|
||||
|
||||
for (const activeExecution of results[1]) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user