summaryrefslogtreecommitdiff
path: root/modules/exif/helpers/exif_task.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-30 13:29:05 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-30 13:29:05 -0700
commitaf6bfa3c71ccc2d45d3029c96f934a7ecd2c2143 (patch)
tree4f8bceae0898a7618ab828167e2b0ddbc9130ed0 /modules/exif/helpers/exif_task.php
parenteca8a366e0623bbfc6aa07e6347a9b0cc768f6d9 (diff)
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.
Diffstat (limited to 'modules/exif/helpers/exif_task.php')
-rw-r--r--modules/exif/helpers/exif_task.php12
1 files changed, 9 insertions, 3 deletions
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();