This commit is contained in:
Andras Bacsai 2023-05-24 15:19:39 +02:00
parent a36ab6486d
commit a0306f3951
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,9 @@
use Illuminate\Support\Facades\Process; use Illuminate\Support\Facades\Process;
use Spatie\Activitylog\Models\Activity; use Spatie\Activitylog\Models\Activity;
const TIMEOUT = 3600;
const IDLE_TIMEOUT = 3600;
class RunRemoteProcess class RunRemoteProcess
{ {
public Activity $activity; public Activity $activity;
@ -52,7 +55,7 @@ public function __invoke(): ProcessResult
$status = ProcessStatus::IN_PROGRESS; $status = ProcessStatus::IN_PROGRESS;
$processResult = Process::run($this->getCommand(), $this->handleOutput(...)); $processResult = Process::timeout(TIMEOUT)->idleTimeout(IDLE_TIMEOUT)->run($this->getCommand(), $this->handleOutput(...));
if ($this->activity->properties->get('status') === ProcessStatus::ERROR->value) { if ($this->activity->properties->get('status') === ProcessStatus::ERROR->value) {
$status = ProcessStatus::ERROR; $status = ProcessStatus::ERROR;

View File

@ -19,7 +19,6 @@
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Spatie\Url\Url; use Spatie\Url\Url;
use Throwable;
class ApplicationDeploymentJob implements ShouldQueue class ApplicationDeploymentJob implements ShouldQueue
{ {