Skip to content

Commit ebc3e97

Browse files
committed
Bugfix: Workerkey Update query now correctly uses Tableprefix, closes #5
1 parent fc5084f commit ebc3e97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/queued_task.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function requestJob($capabilities) {
9696
// Generate a unique Identifier for the current worker thread
9797
$key = sha1(microtime());
9898
// try to update one of the found tasks with the key of this worker.
99-
$this->query('UPDATE ' . $this->table . ' SET workerkey = "' . $key . '", fetched = "' . date('Y-m-d H:i:s') . '" WHERE id in(' . implode(',', $idlist) . ') AND (workerkey IS NULL OR fetched <= "' . date('Y-m-d H:i:s', time() - $task['timeout']) . '") ORDER BY timediff(NOW(),notbefore) DESC LIMIT 1');
99+
$this->query('UPDATE ' . $this->tablePrefix . $this->table . ' SET workerkey = "' . $key . '", fetched = "' . date('Y-m-d H:i:s') . '" WHERE id in(' . implode(',', $idlist) . ') AND (workerkey IS NULL OR fetched <= "' . date('Y-m-d H:i:s', time() - $task['timeout']) . '") ORDER BY timediff(NOW(),notbefore) DESC LIMIT 1');
100100
// read which one actually got updated, which is the job we are supposed to execute.
101101
$data = $this->find('first', array(
102102
'conditions' => array(

0 commit comments

Comments
 (0)