Skip to content

Commit 3f46e81

Browse files
committed
fixup! fixup! fixup! murdock: drop fasttrack_queue, use PriorityQueue
1 parent 08ad67b commit 3f46e81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

murdock/murdock.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"reopened",
4848
]
4949

50-
JOB_FASTTRACK_BONUS = -100
50+
JOB_FASTTRACK_BONUS = 100
5151

5252

5353
@dataclass(order=True)
@@ -221,7 +221,9 @@ async def add_job_to_queue(self, job: MurdockJob):
221221
else:
222222
prio = 0
223223

224-
self.queue.put_nowait(PrioritizedItem(prio, job))
224+
# PriorityQueue is a min_queue, but "higher priority equals higher value"
225+
# makes more sense. So, invert the priority by multiplying with `-1`
226+
self.queue.put_nowait(PrioritizedItem(prio * -1, job))
225227

226228
LOGGER.info(f"{job} added to queued jobs")
227229
await self.reload_jobs()

0 commit comments

Comments
 (0)