Skip to content

Commit

Permalink
Merge pull request #338 from shashwatbangar/#85zrh3hjv
Browse files Browse the repository at this point in the history
Implemented: Added cancelScheduledJob service to cancel job(#85zrh3hjv)
  • Loading branch information
adityasharma7 authored Jan 17, 2023
2 parents 8a9662b + b7eea5d commit f7e2bac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 11 additions & 1 deletion src/services/JobService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,22 @@ const getAutoCancelDays = async (payload: any): Promise <any> => {
params: payload
});
}

const cancelJob = async (payload: any): Promise <any> => {
return api({
url: "service/cancelScheduledJob",
method: "post",
data: payload
});
}

export const JobService = {
fetchJobDescription,
fetchJobInformation,
fetchTemporalExpression,
updateJob,
scheduleJob,
updateAutoCancelDays,
getAutoCancelDays
getAutoCancelDays,
cancelJob
}
8 changes: 2 additions & 6 deletions src/store/modules/job/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,8 @@ const actions: ActionTree<JobState, RootState> = {
let resp;

try {
resp = await JobService.updateJob({
jobId: job.jobId,
systemJobEnumId: job.systemJobEnumId,
statusId: "SERVICE_CANCELLED",
recurrenceTimeZone: this.state.user.current.userTimeZone,
cancelDateTime: DateTime.now().toMillis()
resp = await JobService.cancelJob({
jobId: job.jobId
});
if (resp.status == 200 && !hasError(resp)) {
// TODO: When we are trying to cancel the job from pipeline page those jobs are not in the cached state, so we need to
Expand Down

0 comments on commit f7e2bac

Please sign in to comment.