dadi / queue

A lightweight, RSMQ-powered asynchronous task queue featuring simple task routing and throttling.
GNU Affero General Public License v3.0
14 stars 4 forks source link

Rsmq constructor accepts two arguments - otherwise will default to localhost #12

Closed danwdart closed 6 years ago

danwdart commented 6 years ago

https://github.com/dadi/queue/blob/66098e1fbf3a34004dceb5c5c6f42b6b8d7b422b/lib/broker.js#L141

The first argument is queue name and second is options which includes a key called "host"

however the constructor is only being called with the first arg, so the options are not being passed through

I'd recommend calling like:

return new Rsmq(options.broker.queue, options.queue)

where options is from the top level (for instance on line 40 https://github.com/dadi/queue/blob/66098e1fbf3a34004dceb5c5c6f42b6b8d7b422b/lib/broker.js#L40

I changed to:

this.rsmq = this.initialiseQueue(config.get(''))

for now

adamkdean commented 6 years ago

Looks like this is the case indeed:

https://github.com/mpneuried/rsmq-worker/blob/master/_src/lib/rsmq-worker.coffee#L65

I will get this fixed. Thanks @danwdart!