Closed skolesnyk closed 8 years ago
Here's key in redis
{
"type": "unique_every",
"data": {
"to": "callerid",
"unique": "unique_every",
"schedule": "RECCUR",
"expiryKey": "d:scheduler:unique_every",
"dataKey": "d:scheduler:data:unique_every"
},
"priority": 0,
"progress": 0,
"attempts": {
"made": 0,
"remaining": 3,
"max": 3
},
"reccurInterval": "5 seconds",
"backoff": {
"delay": 60000,
"type": "fixed"
}
}
Also, there's inconsistency between this readme.md and example you have in lib in create('every') whereas in readme you've got create('unique_every').
* 2. create unique job
* var job = Queue
* .create('every', data)
* .attempts(3)
* .priority('normal')
* .unique(<unique_key>);
*
* Queue.every('2 seconds', job);
@skolesnyk
Hello,
There are two types of recur jobs.
1. One that keep a single instance of a job and which need unique recur key
You have to choose one based on your schedule scenario.
If you dont want to keep history use second option otherwise first options.
@lykmapipo , Queue.every just doesn't run at all. No matter whether unique or non unique. Only scheduled jobs run. How could it be?
I can see the key for RECCUR job is created in redis, but that's it.
@skolesnyk
Have you read migration guide for kue?. I bet that may be a problem. Try cross check the kue version your are using.
I will appreciate pull request to upgrade to latest kue
I've downgraded to kue 0.9.6, flushall in redis. I'm using custom port settings.
var kue = require('kue-scheduler')
, Queue = kue.createQueue({
prefix: 'd',
redis: {
port: config.get("REDIS.PORT"),
host: config.get("REDIS.HOST"),
db: 3, // if provided select a non-default redis db
options: {
}
}
});
This event never fires.
Queue.on('schedule success', function(job) {
console.log('success', job.id);
});
There's only one job in redis. And it's stuck.
{
"type": "test",
"data": {
"to": "callerid",
"unique": "unique_every",
"schedule": "RECCUR",
"expiryKey": "d:scheduler:unique_every",
"dataKey": "d:scheduler:data:unique_every"
},
"priority": 0,
"progress": 0,
"attempts": {
"made": 0,
"remaining": 3,
"max": 3
},
"reccurInterval": "5 seconds",
"backoff": {
"delay": 60000,
"type": "fixed"
}
}
@skolesnyk
You may also listen to Schedule Error hope it will help.
Of course I do. Again, nothing there. Don't you find it strange that schedule jobs work fine, but not recurring jobs?
Queue.on('schedule error', function(error) { //handle all scheduling errors here console.log(error); });
@skolesnyk
Check latest version
Will do!
schedule and schedule_unique works, but not 'every' .
I'm developing in loopback.
Also, why do scheduled finished jobs are keep piling up in redis TTL -1? Is there a point of keeping history of those jobs?