Skip to content

Commit

Permalink
Detect the case where there are no more broken images and skip to the…
Browse files Browse the repository at this point in the history
… end. Fixes #1414.
  • Loading branch information
bharat committed Oct 3, 2010
1 parent 161bbb9 commit a153ca0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/gallery/helpers/gallery_task.php
Expand Up @@ -84,6 +84,13 @@ static function rebuild_dirty_images($task) {
$ignored = $task->get("ignored", array());

$i = 0;

// If there's no work left to do, skip to the end. This can happen if we resume a task long
// after the work got done in some other task.
if (!$result->count()) {
$completed = $total_count;
}

foreach ($result as $row) {
if (array_key_exists($row->id, $ignored)) {
continue;
Expand Down

0 comments on commit a153ca0

Please sign in to comment.