Skip to content
Snippets Groups Projects
Commit 3dda89d0 authored by Iain Bryson's avatar Iain Bryson
Browse files

Fix unclear ordering.

parent 6d8ac260
No related branches found
No related tags found
No related merge requests found
......@@ -78,10 +78,11 @@ export function initAgenda(dbs) {
a.on('complete', function (job) {
if (job.attrs.status !== 'failed') {
if (job.attrs.failReason) {
if (job.attrs.data.logs)
if (job.attrs.data.logs) {
job.attrs.data.logs.push(job.attrs.failReason);
else
} else {
job.attrs.data.logs = [job.attrs.failReason];
}
job.attrs.status = 'failed';
job.attrs.data.status = 'failed';
} else {
......@@ -90,6 +91,11 @@ export function initAgenda(dbs) {
}
job.save();
}
if (job.attrs.status === 'running') {
job.attrs.status = 'completed';
job.attrs.data.status = 'completed';
job.save();
}
logger.info('Job %s finished: %s', job.attrs.name, job.attrs.status);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment