Skip to content

Commit

Permalink
fix(queuejobsbystate): bring logs only in job page
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Mar 11, 2021
1 parent ca4fefc commit 8ebd5c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/server/views/dashboard/jobDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ async function handler(req, res) {
job.retryButtonText = jobState === 'failed' ? 'Retry' : 'Trigger';
const stacktraces = queue.IS_BEE ? job.options.stacktraces : job.stacktrace;

if (!queue.IS_BEE) {
const logs = await queue.getJobLogs(job.id);
job.logs = logs.logs || 'No Logs';
}

return res.render('dashboard/templates/jobDetails', {
basePath,
queueName,
Expand Down
7 changes: 0 additions & 7 deletions src/server/views/dashboard/queueJobsByState.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ async function _html(req, res) {
} else {
const stateTypes = state === 'waiting' ? ['wait', 'paused'] : state;
jobs = await queue.getJobs(stateTypes, startId, endId, order === 'asc');
await Promise.all(
jobs.map(async (job) => {
const 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 8ebd5c0

Please sign in to comment.