Skip to content

Commit

Permalink
Queue delay checks only with the current job
Browse files Browse the repository at this point in the history
  • Loading branch information
Jnesselr committed May 5, 2015
1 parent 02dc6f7 commit 5e7653b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions models/Bot/bot.php
Expand Up @@ -315,10 +315,9 @@ public function canGrab($job)

$sql = "select DATE_SUB(NOW(), INTERVAL queues.delay SECOND) > MAX(jobs.taken_time)
FROM queues, jobs
WHERE queues.id = jobs.queue_id
AND queues.id IN
(SELECT queue_id from bot_queues where bot_id = ?)";
if(db()->getValue($sql, array($this->id)) == 0)
WHERE queues.id = ?
AND queues.id = jobs.queue_id";
if(db()->getValue($sql, array($job->getQueue()->id)) == 0)
return false;

return true;
Expand Down

0 comments on commit 5e7653b

Please sign in to comment.