Closed jdulude closed 8 years ago
Did you run into any problems because this should be multiplied by -1 here: https://github.com/schmittjoh/JMSJobQueueBundle/blob/252f93dbc293905d05e19ed9a230246235a2b8f2/Entity/Job.php#L204
Well what I ran into was noticing that my -5 jobs were running before the 0 or 5 priority jobs and when looking at the code it seemed like the sort should be DESC rather then ASC.
Ah ok I see what you're saying now. I was expected the db to read the same as the code and was getting confused. Thanks for the explanation.
The const's inside the Job.php file that specify the priority of LOW, DEFAULT, and HIGH are in reverse order from the sorting within the JobRepository->findPendingJob method. See below...
Entity/Job.php
const PRIORITY_LOW = -5; const PRIORITY_DEFAULT = 0; const PRIORITY_HIGH = 5;
Entity/Repository/JobRepository.php -> findPendingJob method
->orderBy('j.priority', 'ASC')