summaryrefslogtreecommitdiff
path: root/modules/search
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-08-30 18:27:40 -0700
committerAndy Staudacher <andy.st@gmail.com>2009-08-30 18:27:40 -0700
commite7f5e0a9a3a19d535a69e19c4527800096ae1aaa (patch)
tree15662d3291b18ae0aefa6b2cea04d2f2fcf54740 /modules/search
parentdf38a890a64dd33eafe3aed51ce8fde732cf8b8b (diff)
parent31dcdcc6ad6ce47c03265f3d6e499774a17ff727 (diff)
Merge commit 'upstream/master'
Conflicts: modules/gallery/views/l10n_client.html.php modules/organize/views/organize_tree.html.php modules/server_add/helpers/server_add_event.php
Diffstat (limited to 'modules/search')
-rw-r--r--modules/search/helpers/search_task.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/search/helpers/search_task.php b/modules/search/helpers/search_task.php
index 5643573a..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);
}
search::update($item);
$completed++;
+
+ if (microtime(true) - $start > 1.5) {
+ break;
+ }
}
list ($remaining, $total, $percent) = search::stats();