summaryrefslogtreecommitdiff
path: root/modules/search/helpers/search_task.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/search/helpers/search_task.php')
-rw-r--r--modules/search/helpers/search_task.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/search/helpers/search_task.php b/modules/search/helpers/search_task.php
index df1dfe16..9508f420 100644
--- a/modules/search/helpers/search_task.php
+++ b/modules/search/helpers/search_task.php
@@ -48,12 +48,18 @@ class search_task_Core {
->where("search_records.item_id", null)
->orwhere("search_records.dirty", 1)
->find_all() as $item) {
- if (microtime(true) - $start > 1.5) {
- break;
+ // The query above can take a long time, so start the timer after its done
+ // to give ourselves a little time to actually process rows.
+ if (!isset($start)) {
+ $start = microtime(true);
}
- $message[] = search::update($item);
+ search::update($item);
$completed++;
+
+ if (microtime(true) - $start > 1.5) {
+ break;
+ }
}
list ($remaining, $total, $percent) = search::stats();
@@ -69,13 +75,10 @@ class search_task_Core {
$task->status = t2("one record updated, index is %percent% up-to-date",
"%count records updated, index is %percent% up-to-date",
$completed, array("percent" => $percent));
- $message[] = $task->status;
} catch (Exception $e) {
$task->done = true;
$task->state = "error";
$task->status = $e->getMessage();
- $message[] = $e->__toString();
}
- $task->log($message);
}
}