Skip to content

Commit

Permalink
Update queue name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mugli committed Oct 5, 2019
1 parent 8057690 commit 836d8e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export class Consumer {
throw new Error('workerFn is required');
}

if (!qname) {
throw new Error('qname is required');
if (!qname || qname === defaultOptions.INTERNALS) {
throw new Error(`qname cannot be empty or set as "${defaultOptions.INTERNALS}"`);
}

this.consumers = [];
Expand Down
4 changes: 2 additions & 2 deletions src/producer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export class Producer {
this._redis = new IORedis(this._redisOptions) as Redis;
}

if (!qname) {
throw new Error('qname is required');
if (!qname || qname === defaultOptions.INTERNALS) {
throw new Error(`qname cannot be empty or set as "${defaultOptions.INTERNALS}"`);
}

this._QNAME = `${defaultOptions.NAMESPACE}:queue:${qname}`;
Expand Down

0 comments on commit 836d8e2

Please sign in to comment.