mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Handle memory issues gracefully (#5147)
* fix: add lost connection error * fix: stop exec, open in new tab * fix: only hosw if error failed * fix: fix typo * chore: eslint issue
This commit is contained in:
@@ -38,6 +38,8 @@ export const pushConnection = mixins(
|
||||
reconnectTimeout: null as NodeJS.Timeout | null,
|
||||
retryTimeout: null as NodeJS.Timeout | null,
|
||||
pushMessageQueue: [] as Array<{ event: Event; retriesLeft: number }>,
|
||||
connectRetries: 0,
|
||||
lostConnection: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -53,6 +55,21 @@ export const pushConnection = mixins(
|
||||
}
|
||||
|
||||
this.reconnectTimeout = setTimeout(() => {
|
||||
this.connectRetries++;
|
||||
const isWorkflowRunning = this.uiStore.isActionActive('workflowRunning');
|
||||
if (this.connectRetries > 3 && !this.lostConnection && isWorkflowRunning) {
|
||||
this.lostConnection = true;
|
||||
|
||||
this.workflowsStore.executingNode = null;
|
||||
this.uiStore.removeActiveAction('workflowRunning');
|
||||
|
||||
this.$showMessage({
|
||||
title: this.$locale.baseText('pushConnection.executionFailed'),
|
||||
message: this.$locale.baseText('pushConnection.executionFailed.message'),
|
||||
type: 'error',
|
||||
duration: 0,
|
||||
});
|
||||
}
|
||||
this.pushConnect();
|
||||
}, 3000);
|
||||
},
|
||||
@@ -73,6 +90,9 @@ export const pushConnection = mixins(
|
||||
this.eventSource.addEventListener(
|
||||
'open',
|
||||
() => {
|
||||
this.connectRetries = 0;
|
||||
this.lostConnection = false;
|
||||
|
||||
this.rootStore.pushConnectionActive = true;
|
||||
if (this.reconnectTimeout !== null) {
|
||||
clearTimeout(this.reconnectTimeout);
|
||||
|
||||
Reference in New Issue
Block a user