Skip to content

Commit

Permalink
Clean up the task initialization for rebuild thumbs and resizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Almdal committed Sep 28, 2009
1 parent c97a885 commit ab5e680
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/gallery/helpers/gallery_task.php
Expand Up @@ -48,11 +48,13 @@ static function rebuild_dirty_images($task) {
$errors = array();
try {
$result = graphics::find_dirty_images_query();
$total_count = $task->get("total_count", -1);
if ($total_count < 0) {
$total_count = $result->count();
$total_count = $task->get("total_count", $result->count());
$mode = $task->get("mode", "init");
if ($mode == "init") {
$task->set("total_count", $total_count);
$task->get("mode", "process");
}

$completed = $task->get("completed", 0);
$ignored = $task->get("ignored", array());

Expand Down

0 comments on commit ab5e680

Please sign in to comment.