mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
better handling of timeout
This commit is contained in:
parent
fab21da3d8
commit
2cfc080382
|
@ -39,16 +39,17 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
do {
|
|
||||||
$timeleft = $timeout - time();
|
$timeleft = $timeout - time();
|
||||||
$read = array($pipes[1]);
|
$read = array($pipes[1]);
|
||||||
$write = NULL;
|
$write = NULL;
|
||||||
$exeptions = NULL;
|
$exeptions = NULL;
|
||||||
|
do {
|
||||||
stream_select($read, $write, $exeptions, $timeleft, 200000);
|
stream_select($read, $write, $exeptions, $timeleft, 200000);
|
||||||
|
|
||||||
if (!empty($read)) {
|
if (!empty($read)) {
|
||||||
$output .= fread($pipes[1], 8192);
|
$output .= fread($pipes[1], 8192);
|
||||||
}
|
}
|
||||||
|
$timeleft = $timeout - time();
|
||||||
} while (!feof($pipes[1]) && $timeleft > 0);
|
} while (!feof($pipes[1]) && $timeleft > 0);
|
||||||
|
|
||||||
if ($timeleft <= 0) {
|
if ($timeleft <= 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user