Improve workflow retry

This commit is contained in:
Jan Oberhauser
2019-08-09 07:37:10 +02:00
parent d59a043e3f
commit 886100eeef
9 changed files with 38 additions and 25 deletions

View File

@@ -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 {

View File

@@ -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 () {

View File

@@ -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,
};

View File

@@ -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`);
},