Skip to content

the queue is not running on the redis  #12

@farshadfahimi

Description

@farshadfahimi

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions