Skip to content

Commit

Permalink
fix(job-details): correctly wait for promises (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
skeggse authored Oct 29, 2020
1 parent fabc31d commit 934e92a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/server/views/dashboard/queueJobsByState.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ async function _html(req, res) {
jobs = jobs.filter((job) => job);
} else {
jobs = await queue[`get${_.capitalize(state)}`](startId, endId);
await jobs.map(async (job) => {
let logs = await queue.getJobLogs(job.id);
job.logs = logs.logs || 'No Logs';
return job;
});
await jobs.map(
Promise.all(async (job) => {
let logs = await queue.getJobLogs(job.id);
job.logs = logs.logs || 'No Logs';
return job;
})
);
}

for (const job of jobs) {
Expand Down

0 comments on commit 934e92a

Please sign in to comment.