Skip to content

Commit

Permalink
When batching, update the 'when' time to the lesser of the existing b…
Browse files Browse the repository at this point in the history
…atch and the new job.
  • Loading branch information
lunaru committed Sep 16, 2010
1 parent ec9f6da commit d2ba6c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MongoQueue.php
Expand Up @@ -42,7 +42,7 @@ public static function push($className, $methodName, $parameters, $when, $batch
{
$job = $job['value'];

if (!isset($job['when']))
if (!isset($job['when']) || $job['when'] > $when)
{
$job['when'] = $when;
$collection->save($job);
Expand Down

0 comments on commit d2ba6c8

Please sign in to comment.