I have a simple job like below
'use strict'
const Job = use('Job')
class Test extends Job {
constructor(){
super(arguments)
this.timeOut = 2000; // seconds: time out for queue
this.retryCount = 0; // number of times to retry
this.retryUntil = 200; // seconds: retry
this.delayUntil = 0; // seconds: delay
}
get queue () {
return 'high'
}
async handle(link, done) {
// ...
console.log(`Job [${this.constructor.name}] - handler called: status=running; id=${this.id} `)
}
progress(progress) {
// ...
console.log(`Job [${this.constructor.name}] - progress:${progress}%: status=running; id=${this.id} `)
}
failed(error) {
// ...
console.log(`Job [${this.constructor.name}] - status:failed; id=${this.id} `, error.message)
}
retrying(error){
// ...
console.log(`Job [${this.constructor.name}] - status:retrying; id=${this.id} `, error.message)
}
succeeded(result){
// ...
console.log(`Job [${this.constructor.name}] - status:succeeded; id=${this.id} `, result)
}
}
module.exports = Test
and simple in my controller just write the code for test the queue
queue.dispatch(new Test())
when this action is call in the console I got the below log
@@adonisjs/Queue: [Redis] Queue [high] now ready
but the handler method is not running and when I'm checking the redis the keys is empty.
the configoration of the queue is default config without any changes.
How should I run the queue ?
I have a simple job like below
and simple in my controller just write the code for test the queue
queue.dispatch(new Test())when this action is call in the console I got the below log
but the handler method is not running and when I'm checking the redis the keys is empty.
the configoration of the queue is default config without any changes.
How should I run the queue ?