OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Priority doesn't seem to be taking effect

admangan opened this issue · comments

I am curious whether anyone else has used the new implementation of priority (1 being highest on down) successfully. I use bull to run tasks made up of small sub jobs, some tasks need to be run first. Despite setting up priority properly (I see it in the job options) the queue continues processing in a FIFO manner.

Am I missing something in the set up? Do I need to adjust queue set up ( I am running this in a nest js app).

Any help is appreciated.

Yes, we have tests that cover all the priority functionality: https://github.com/OptimalBits/bull/blob/develop/test/test_queue.js#L1041
It is difficult to know why it does not work for you as you are not providing a test case for us to reproduce.

If you are new to Bull you should use BullMQ instead: https://github.com/taskforcesh/bullmq

Thanks for the reply, we have set up our system on bull but am looking at migrating over to bullmq. Is it as compatible with the nest.js architecture?

The test you shared, started processing the jobs after all have been added. My use case is adding large numbers of jobs at different times (can only run ~50 / minute) and having the higher (lower number) priority jump ahead in the queue even though they have been added later.

I will make a test case to demonstrate this. If it affects, I am using elasticache as my redis cluster.