mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
fix(editor): Fix an infinite loop while loading executions that are not on the current executions list (#5071)
fix(editor): Fix an infinitine loop while loading executions that are not on the current executions list
This commit is contained in:
parent
0ec66bfb42
commit
8cf3c86860
|
@ -426,9 +426,9 @@ export default mixins(
|
|||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
async tryToFindExecution(executionId: string, skipCheck = false): Promise<void> {
|
||||
async tryToFindExecution(executionId: string, attemptCount = 0): Promise<void> {
|
||||
// First check if executions exists in the DB at all
|
||||
if (!skipCheck) {
|
||||
if (attemptCount === 0) {
|
||||
const executionExists = await this.workflowsStore.fetchExecutionDataById(executionId);
|
||||
if (!executionExists) {
|
||||
this.workflowsStore.activeWorkflowExecution = null;
|
||||
|
@ -443,6 +443,10 @@ export default mixins(
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// stop if the execution wasn't found in the first 1000 lookups
|
||||
if (attemptCount >= 10) return;
|
||||
|
||||
// Fetch next batch of executions
|
||||
await this.loadMore(100);
|
||||
const execution = this.workflowsStore.getExecutionDataById(executionId);
|
||||
|
@ -450,7 +454,7 @@ export default mixins(
|
|||
// If it's not there load next until found
|
||||
await this.$nextTick();
|
||||
// But skip fetching execution data since we at this point know it exists
|
||||
await this.tryToFindExecution(executionId, true);
|
||||
await this.tryToFindExecution(executionId, attemptCount + 1);
|
||||
} else {
|
||||
// When found set execution as active
|
||||
this.workflowsStore.activeWorkflowExecution = execution;
|
||||
|
|
Loading…
Reference in a new issue