Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purge compute job after recording results. Closes #1978 #1979

Merged
merged 2 commits into from
Nov 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Replace return with await
  • Loading branch information
brollb committed Nov 11, 2020
commit 4ecc033da69570e73505d170b06e6215e6e8b538
16 changes: 9 additions & 7 deletions src/plugins/ExecuteJob/ExecuteJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,11 @@ define([

ExecuteJob.prototype.onOperationEnd = async function (err, job) {
if (err) {
return this.onOperationFail(job, err);
await this.onOperationFail(job, err);
return;
} else if (this.isLocalOperation(job)) {
return this.onOperationComplete(job);
await this.onOperationComplete(job);
return;
}

const op = await this.getOperation(job);
Expand All @@ -666,7 +668,7 @@ define([
this.logger.debug(`"${name}" has been CANCELED!`);
const stdout = await this.logManager.getLog(jobId);
this.core.setAttribute(job, 'stdout', stdout);
return this.onOperationCanceled(op);
await this.onOperationCanceled(op);
}

if (status === this.compute.SUCCESS || status === this.compute.FAILED) {
Expand All @@ -679,14 +681,14 @@ define([
this.logManager.deleteLog(jobId);
if (status === this.compute.SUCCESS) {
const results = await this.compute.getResultsInfo(jobInfo);
return this.recordOperationOutputs(op, results);
await this.recordOperationOutputs(op, results);
} else {
// Parse the most precise error and present it in the toast...
const lastline = result.stdout.split('\n').filter(l => !!l).pop() || '';
if (lastline.includes('Error')) {
return this.onOperationFail(op, lastline);
await this.onOperationFail(op, lastline);
} else {
return this.onOperationFail(op, `Operation "${opName}" failed!`);
await this.onOperationFail(op, `Operation "${opName}" failed!`);
}
}
} else { // something bad happened...
Expand All @@ -695,7 +697,7 @@ define([

this.core.setAttribute(job, 'stdout', consoleErr);
this.logger.error(err);
return this.onOperationFail(op, err);
await this.onOperationFail(op, err);
}
};

Expand Down