Skip to content

Commit

Permalink
wait for process to end
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Mar 27, 2024
1 parent d4d9958 commit f25151b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Util/PHP/DefaultPhpProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
use function is_array;
use function is_resource;
use function proc_close;
use function proc_get_status;
use function proc_open;
use function rewind;
use function stream_get_contents;
use function sys_get_temp_dir;
use function tempnam;
use function time_nanosleep;
use function unlink;
use PHPUnit\Framework\Exception;

Expand Down Expand Up @@ -119,6 +121,10 @@ protected function runProcess(string $job, array $settings): array

fclose($pipes[0]);

while (proc_get_status($process)['running'] === true) {
time_nanosleep(0, 100000);
}

$stderr = $stdout = '';

if (isset($pipes[1])) {
Expand Down

0 comments on commit f25151b

Please sign in to comment.