projectReport = $projectReport; // } /** * Execute the job. */ public function handle(): void { logger('in handle'); $this->projectReport->weeksAgo(); $projectFolder = base_path('../'); $command = [ sprintf('%sbuild_report.sh', $projectFolder), sprintf('--filename=%s', $this->projectReport->getFullPathName()), sprintf('--weeks_ago=%s', $this->projectReport->weeksAgo()), sprintf('--report_date=%s', $this->projectReport->getReportDate()), ]; // Convert commands array to a single string $process = new Process($command); $process->setTimeout(220); $currentPath = '/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin/Users/mfolkerts/anaconda3/bin:/Library/Apple/usr/bin'; $process->setEnv(['PATH' => $currentPath.':/usr/local/Cellar/pandoc/3.1.8/bin/pandoc']); // $process->setTimeout(36000); // stel een geschikte timeout in $process->start(); try { $myOutput = []; $process->wait(function ($type, $buffer) use (&$myOutput) { // $this->stream(to: 'processOutput', content: $buffer); $myOutput[] = $buffer; logger($buffer); }); $this->processOutput = collect($myOutput)->join('\n'); $this->projectReport->setStatusSuccess(); } catch (ProcessFailedException $exception) { echo $exception->getMessage(); $this->projectReport->setStatusFailed(); } // } }