better handling of timeout

This commit is contained in:
Uwe Steinmann 2017-03-01 16:18:27 +01:00
parent fab21da3d8
commit 2cfc080382
2 changed files with 10 additions and 9 deletions

View File

@ -39,16 +39,17 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
}
$output = '';
do {
$timeleft = $timeout - time();
$read = array($pipes[1]);
$write = NULL;
$exeptions = NULL;
do {
stream_select($read, $write, $exeptions, $timeleft, 200000);
if (!empty($read)) {
$output .= fread($pipes[1], 8192);
}
$timeleft = $timeout - time();
} while (!feof($pipes[1]) && $timeleft > 0);
if ($timeleft <= 0) {