| 57 | }); |
| 58 | |
| 59 | function makeQueue(...args) { |
| 60 | if (redisUrl) { |
| 61 | if (args.length === 0) { |
| 62 | args.push({}); |
| 63 | } |
| 64 | if (!args[0].redis) { |
| 65 | // Note: we don't fuss with isClient(redis) because it's simpler to just |
| 66 | // add the host setting in the test code itself when redis is used |
| 67 | args[0].redis = redisUrl; |
| 68 | } |
| 69 | } |
| 70 | const queue = new Queue(ctx.queueName, ...args); |
| 71 | queue.on('error', (err) => ctx.queueErrors.push(err)); |
| 72 | ctx.queues.push(queue); |
| 73 | return queue; |
| 74 | } |
| 75 | |
| 76 | function handleErrors(t) { |
| 77 | if (t) return t.notThrows(handleErrors); |