mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
⚡ Improve workflow retry
This commit is contained in:
@@ -143,7 +143,7 @@ export interface IRestApi {
|
||||
getCredentialTypes(): Promise<ICredentialType[]>;
|
||||
getExecution(id: string): Promise<IExecutionResponse>;
|
||||
deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void>;
|
||||
retryExecution(id: string): Promise<IExecutionResponse>;
|
||||
retryExecution(id: string): Promise<boolean>;
|
||||
getTimezones(): Promise<IDataObject>;
|
||||
}
|
||||
|
||||
@@ -303,6 +303,8 @@ export interface IExecutionsCurrentSummaryExtended {
|
||||
idActive: string;
|
||||
finished?: boolean;
|
||||
mode: WorkflowExecuteMode;
|
||||
retryOf?: string;
|
||||
retrySuccessId?: string;
|
||||
startedAt: Date;
|
||||
stoppedAt?: Date;
|
||||
workflowId: string;
|
||||
@@ -356,6 +358,7 @@ export interface IPushDataExecutionFinished {
|
||||
data: IRun;
|
||||
executionIdActive: string;
|
||||
executionIdDb?: string;
|
||||
retryOf?: string;
|
||||
}
|
||||
|
||||
export interface IPushDataExecutionStarted {
|
||||
|
||||
@@ -390,9 +390,9 @@ export default mixins(
|
||||
this.isDataLoading = true;
|
||||
|
||||
try {
|
||||
const data = await this.restApi().retryExecution(execution.id);
|
||||
const retrySuccessful = await this.restApi().retryExecution(execution.id);
|
||||
|
||||
if (data.finished === true) {
|
||||
if (retrySuccessful === true) {
|
||||
this.$showMessage({
|
||||
title: 'Retry successful',
|
||||
message: 'The retry was successful!',
|
||||
@@ -406,13 +406,11 @@ export default mixins(
|
||||
});
|
||||
}
|
||||
|
||||
this.refreshData();
|
||||
this.isDataLoading = false;
|
||||
} catch (error) {
|
||||
this.$showError(error, 'Problem with retry', 'There was a problem with the retry:');
|
||||
|
||||
this.isDataLoading = false;
|
||||
this.refreshData();
|
||||
}
|
||||
},
|
||||
async refreshData () {
|
||||
|
||||
@@ -160,7 +160,6 @@ export const pushConnection = mixins(
|
||||
|
||||
const runDataExecuted = pushData.data;
|
||||
|
||||
|
||||
if (runDataExecuted.finished !== true) {
|
||||
// There was a problem with executing the workflow
|
||||
let errorMessage = 'There was a problem executing the workflow!';
|
||||
@@ -202,6 +201,7 @@ export const pushConnection = mixins(
|
||||
finished: false,
|
||||
mode: pushData.mode,
|
||||
startedAt: pushData.startedAt,
|
||||
retryOf: pushData.retryOf,
|
||||
workflowId: pushData.workflowId,
|
||||
workflowName: pushData.workflowName,
|
||||
};
|
||||
|
||||
@@ -263,7 +263,7 @@ export const restApi = Vue.extend({
|
||||
},
|
||||
|
||||
// Returns the execution with the given name
|
||||
retryExecution: (id: string): Promise<IExecutionResponse> => {
|
||||
retryExecution: (id: string): Promise<boolean> => {
|
||||
return self.restApi().makeRestApiRequest('POST', `/executions/${id}/retry`);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user