Skip to content

Commit 4c395c3

Browse files
author
Symphosize
committed
Merge pull request #3 from Symphosize/features/priority
actually making the priority sorting work when the claiming happens f…
2 parents da5a70a + aeefe3c commit 4c395c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Model/QueuedTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function requestJob($capabilities, $group = null) {
186186
//debug($key);ob_flush();
187187

188188
// try to update one of the found tasks with the key of this worker.
189-
$this->query('UPDATE ' . $this->tablePrefix . $this->table . ' SET workerkey = "' . $key . '", fetched = "' . date('Y-m-d H:i:s') . '" WHERE ' . implode(' OR ', $whereClause) . ' ORDER BY ' . $this->virtualFields['age'] . ' ASC, id ASC LIMIT 1');
189+
$this->query('UPDATE ' . $this->tablePrefix . $this->table . ' SET workerkey = "' . $key . '", fetched = "' . date('Y-m-d H:i:s') . '" WHERE ' . implode(' OR ', $whereClause) . ' ORDER BY priority ASC, ' . $this->virtualFields['age'] . ' ASC, id ASC LIMIT 1');
190190

191191
// Read which one actually got updated, which is the job we are supposed to execute.
192192
$data = $this->find('first', [

0 commit comments

Comments
 (0)