Skip to content

Commit

Permalink
fix(bulkaction): handling retry logic in bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Mar 4, 2021
1 parent 52c9b80 commit d396dac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/dashboard.js
Expand Up @@ -108,7 +108,7 @@ $(document).ready(() => {

let data = {
queueName,
action: 'remove',
action,
jobs: [],
};

Expand Down
6 changes: 4 additions & 2 deletions src/server/views/api/bulkAction.js
Expand Up @@ -22,8 +22,10 @@ function bulkAction(action) {
if (!_.isEmpty(jobs)) {
const jobsPromises = jobs.map((id) => queue.getJob(decodeURIComponent(id)));
const fetchedJobs = await Promise.all(jobsPromises);

const actionPromises = fetchedJobs.map((job) => job[action]());
const actionPromises =
action === 'retry'
? fetchedJobs.map((job) => Queues.set(queue, job.data, job.name))
: fetchedJobs.map((job) => job[action]());
await Promise.all(actionPromises);
return res.sendStatus(200);
}
Expand Down

0 comments on commit d396dac

Please sign in to comment.