mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-04 14:11:01 -04:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user