Skip to content

Commit 5954c98

Browse files
authored
Merge pull request #34 from mhagstrand/SleepingWithDelayInQueue
Fix bug where scheduler sleeps when processing a delayed queue
2 parents 894b41d + 073f25f commit 5954c98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ResqueScheduler/Worker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public function work($interval = null)
5555
*/
5656
public function handleDelayedItems($timestamp = null)
5757
{
58-
while (($timestamp = ResqueScheduler::nextDelayedTimestamp($timestamp)) !== false) {
58+
while (($oldestJobTimestamp = ResqueScheduler::nextDelayedTimestamp($timestamp)) !== false) {
5959
$this->updateProcLine('Processing Delayed Items');
60-
$this->enqueueDelayedItemsForTimestamp($timestamp);
60+
$this->enqueueDelayedItemsForTimestamp($oldestJobTimestamp);
6161
}
6262
}
6363

0 commit comments

Comments
 (0)