set micro sec. of stream_select() to 200000

reduces cpu load if timeout was set to 0
This commit is contained in:
Uwe Steinmann 2016-03-29 08:12:20 +02:00
parent 8ac0a99e09
commit ae1afe4c23
3 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
do {
$timeleft = $timeout - time();
$read = array($pipes[1]);
stream_select($read, $write = NULL, $exeptions = NULL, $timeleft, NULL);
stream_select($read, $write = NULL, $exeptions = NULL, $timeleft, 200000);
if (!empty($read)) {
$output .= fread($pipes[1], 8192);

View File

@ -75,7 +75,7 @@ class SeedDMS_Preview_Previewer {
do {
$timeleft = $timeout - time();
$read = array($pipes[1]);
stream_select($read, $write = NULL, $exeptions = NULL, $timeleft, NULL);
stream_select($read, $write = NULL, $exeptions = NULL, $timeleft, 200000);
if (!empty($read)) {
$output .= fread($pipes[1], 8192);

View File

@ -47,7 +47,7 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
do {
$timeleft = $timeout - time();
$read = array($pipes[1]);
stream_select($read, $write = NULL, $exeptions = NULL, $timeleft, NULL);
stream_select($read, $write = NULL, $exeptions = NULL, $timeleft, 200000);
if (!empty($read)) {
$output .= fread($pipes[1], 8192);