mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
(configd, mvc) add connect timeout, closes https://github.com/opnsense/core/issues/913
This commit is contained in:
parent
1d0ae14682
commit
307d9238f5
@ -70,16 +70,17 @@ class Backend
|
||||
* @param string $event event string
|
||||
* @param bool $detach detach process
|
||||
* @param int $timeout timeout in seconds
|
||||
* @param int $connect_timeout connect timeout in seconds
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function configdRun($event, $detach = false, $timeout = 120)
|
||||
public function configdRun($event, $detach = false, $timeout = 120, $connect_timeout = 10)
|
||||
{
|
||||
$endOfStream = chr(0).chr(0).chr(0);
|
||||
$poll_timeout = 2 ; // poll timeout interval
|
||||
|
||||
// wait until socket exist for a maximum of $timeout
|
||||
$timeout_wait = $timeout;
|
||||
// wait until socket exist for a maximum of $connect_timeout
|
||||
$timeout_wait = $connect_timeout;
|
||||
while (!file_exists($this->configdSocket)) {
|
||||
sleep(1);
|
||||
$timeout_wait -= 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user