mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix process related errors
This commit is contained in:
@@ -110,8 +110,8 @@ class TmuxOutput extends Tmux
|
||||
{
|
||||
$buffer = '';
|
||||
$state = ((int) $this->runVar['settings']['is_running'] === 1) ? 'Running' : 'Disabled';
|
||||
$version = Process::run('git describe --tags')->output();
|
||||
$branch = Process::run('git branch')->output();
|
||||
$version = str_replace(["\n", "\r"], '', Process::run('git describe --tags')->output());
|
||||
$branch = str_replace(["\n", "\r"], '', Process::run('git branch --show-current')->output());
|
||||
|
||||
$buffer .= sprintf(
|
||||
$this->tmpMasks[2],
|
||||
|
||||
@@ -12,7 +12,7 @@ use Blacklight\processing\PostProcess;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Opis\Closure\SerializableClosure;
|
||||
use Spatie\Async\Output\SerializableException;
|
||||
use Spatie\Async\Pool;
|
||||
@@ -910,11 +910,20 @@ class Forking
|
||||
//////////////////////////////////////////// Various methods ///////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
protected function _executeCommand(string $command): void
|
||||
/**
|
||||
* @param string $command
|
||||
* @return string
|
||||
*/
|
||||
protected function _executeCommand(string $command): string
|
||||
{
|
||||
Process::timeout(config('nntmux.multiprocessing_max_child_time'))->run($command, function (string $type, string $output) {
|
||||
echo $output;
|
||||
$process = Process::fromShellCommandline($command);
|
||||
$process->setTimeout(1800);
|
||||
$process->run(function ($type, $buffer) {
|
||||
if (Process::ERR === $type) {
|
||||
echo $buffer;
|
||||
}
|
||||
});
|
||||
return $process->getOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,7 @@ class TmuxUIStart extends Command
|
||||
$session = Process::run("tmux list-session | grep $tmux_session");
|
||||
if ($session->exitCode() === 1) {
|
||||
$this->info('Starting the tmux server and monitor script');
|
||||
Process::forever()->tty()->run('php '.app()->/* @scrutinizer ignore-call */ path().'/../misc/update/tmux/run.php');
|
||||
Process::forever()->run('php '.app()->/* @scrutinizer ignore-call */ path().'/../misc/update/tmux/run.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user