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.
This commit is contained in:
Bharat Mediratta
2009-08-30 13:29:05 -07:00
parent eca8a366e0
commit af6bfa3c71
2 changed files with 17 additions and 5 deletions
+9 -3
View File
@@ -50,12 +50,18 @@ class exif_task_Core {
->orwhere("exif_records.dirty", 1)
->close_paren()
->find_all() as $item) {
// 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);
}
exif::extract($item);
$completed++;
if (microtime(true) - $start > 1.5) {
break;
}
$completed++;
exif::extract($item);
}
list ($remaining, $total, $percent) = exif::stats();