Skip to content

Commit f406750

Browse files
authored
fix(remove-repeatable): consider old versions of bull (#580)
1 parent c72a106 commit f406750

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ You can `docker pull` Arena from [Docker Hub](https://hub.docker.com/r/mixmaxhq/
297297

298298
Please see the [docker-arena] repository for details.
299299

300+
### Official UIs
301+
302+
- [Taskforce](https://taskforce.sh) for Bull and Bullmq
303+
300304
### Contributing
301305

302306
See [contributing guidelines](CONTRIBUTING.md) and [an example](example/README.md).

src/server/views/api/repeatableJobRemove.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ async function handler(req, res) {
99
if (!job) return res.status(404).send({error: 'job not found'});
1010

1111
try {
12-
await queue.removeRepeatableByKey(job.opts.repeat.key);
12+
if (job.opts.repeat.key) {
13+
await queue.removeRepeatableByKey(job.opts.repeat.key);
14+
} else {
15+
await queue.removeRepeatable(job.name, job.opts.repeat);
16+
}
1317
return res.sendStatus(200);
1418
} catch (e) {
1519
const body = {

src/server/views/dashboard/jobDetails.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ async function handler(req, res) {
3535
job.showRetryButton = !queue.IS_BEE || jobState === 'failed';
3636
job.retryButtonText = jobState === 'failed' ? 'Retry' : 'Trigger';
3737
job.showPromoteButton = !queue.IS_BEE && jobState === 'delayed';
38-
job.showDeleteRepeatableButton =
39-
queue.IS_BULL && job.opts.repeat && job.opts.repeat.key;
38+
job.showDeleteRepeatableButton = queue.IS_BULL && job.opts.repeat;
4039
const stacktraces = queue.IS_BEE ? job.options.stacktraces : job.stacktrace;
4140

4241
if (!queue.IS_BEE) {

src/server/views/dashboard/queueJobsByState.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ async function _html(req, res) {
130130
job.showRetryButton = !queue.IS_BEE || jobState === 'failed';
131131
job.retryButtonText = jobState === 'failed' ? 'Retry' : 'Trigger';
132132
job.showPromoteButton = !queue.IS_BEE && jobState === 'delayed';
133-
job.showDeleteRepeatableButton =
134-
queue.IS_BULL && job.opts.repeat && job.opts.repeat.key;
133+
job.showDeleteRepeatableButton = queue.IS_BULL && job.opts.repeat;
135134
job.parent = JobHelpers.getKeyProperties(job.parentKey);
136135
}
137136

0 commit comments

Comments
 (0)