diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/exif/helpers/exif_task.php | 12 | ||||
-rw-r--r-- | modules/search/helpers/search_task.php | 10 |
2 files changed, 17 insertions, 5 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(); 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(); |