lykmapipo / kue-scheduler

A job scheduler utility for kue, backed by redis and built for node.js
246 stars 47 forks source link

extend options from kue #27

Closed vikrantpogula closed 8 years ago

vikrantpogula commented 8 years ago

I've tried a couple of configurations to get the options from Kue singleton.

The following works

import kue from 'kue-scheduler';
var queue = kue.createQueue({
  prefix: `defaultQueue`
});

but the following doesn't

import kue from 'kue-scheduler';
var queue = kue.createQueue({
  prefix: `defaultQueue`,
  redis: {
    db: 7, // if provided select a non-default redis db
  }
});

Any help on what I might be doing wrong would be appreciated.

lykmapipo commented 8 years ago

@vikrantpogula

Just know only one kue singleton exist per process so if you try to create it multiple times only the first instance will be returned.

Cross check if there is any part of your codes instantiate kue with default options.

Also I will cross check with kue-scheduler if it fails to merge the options.

lykmapipo commented 8 years ago

@vikrantpogula

See.

Hope it will help.