diff --git a/docs/gitbook/do-not-commit-.md b/docs/gitbook/do-not-commit-.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/gitbook/guide/flows/README.md b/docs/gitbook/guide/flows/README.md index ac86388745..b101f51f43 100644 --- a/docs/gitbook/guide/flows/README.md +++ b/docs/gitbook/guide/flows/README.md @@ -77,6 +77,10 @@ The above call will return instances for all the jobs added to the queue. Note that the parent queue does not need to be the same queue as the one used for the children. {% endhint %} +{% hint style="warning" %} +If a jobId option is provided, make that it does not contain a colon **:** as this is considered a separator. +{% endhint %} + When the parent job is processed it is possible to access the results generated by its child jobs. For example, lets assume the following worker for the child jobs: {% tabs %} diff --git a/src/classes/queue-base.ts b/src/classes/queue-base.ts index a22cf424ac..41097e966d 100644 --- a/src/classes/queue-base.ts +++ b/src/classes/queue-base.ts @@ -53,6 +53,10 @@ export class QueueBase extends EventEmitter implements MinimalQueue { throw new Error('Queue name must be provided'); } + if (name.includes(':')) { + throw new Error('Queue name cannot contain :'); + } + this.connection = new Connection( opts.connection, isRedisInstance(opts.connection), diff --git a/tests/test_queue.ts b/tests/test_queue.ts index 39cc448e6d..75cff55d5d 100644 --- a/tests/test_queue.ts +++ b/tests/test_queue.ts @@ -46,6 +46,18 @@ describe('queues', function () { }); }); + describe('when empty name contains :', () => { + it('throws an error', function () { + expect( + () => + new Queue('name:test', { + connection, + prefix, + }), + ).to.throw('Queue name cannot contain :'); + }); + }); + describe('when empty name is provided', () => { it('throws an error', function () { expect(