From 788a458a11f04e47fe1c241463785d0f0b12cf3c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 19 Jul 2009 13:43:06 -0700 Subject: Remove success logging. Only log on errors, otherwise the log is huge. --- modules/search/helpers/search_task.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'modules/search/helpers/search_task.php') diff --git a/modules/search/helpers/search_task.php b/modules/search/helpers/search_task.php index df1dfe16..5643573a 100644 --- a/modules/search/helpers/search_task.php +++ b/modules/search/helpers/search_task.php @@ -52,7 +52,7 @@ class search_task_Core { break; } - $message[] = search::update($item); + search::update($item); $completed++; } @@ -69,13 +69,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); } } -- cgit v1.2.3 From af6bfa3c71ccc2d45d3029c96f934a7ecd2c2143 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 30 Aug 2009 13:29:05 -0700 Subject: Change the processing time for search_task and exif_task to start the 1.5 second counter only after we've done any expensive queries. This guarantees at least some time to do work. Fixes ticket #693. --- modules/exif/helpers/exif_task.php | 12 +++++++++--- modules/search/helpers/search_task.php | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'modules/search/helpers/search_task.php') diff --git a/modules/exif/helpers/exif_task.php b/modules/exif/helpers/exif_task.php index c269b732..7c4c97c4 100644 --- a/modules/exif/helpers/exif_task.php +++ b/modules/exif/helpers/exif_task.php @@ -50,12 +50,18 @@ class exif_task_Core { ->orwhere("exif_records.dirty", 1) ->close_paren() ->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); } - $completed++; exif::extract($item); + $completed++; + + if (microtime(true) - $start > 1.5) { + break; + } } list ($remaining, $total, $percent) = exif::stats(); 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(); -- cgit v1.2.3