Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
allanmcarvalho committed Jan 26, 2024
1 parent 613894b commit b80789a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Commands/Deploy/Pm2RestartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public function handle(): int
if (self::$fake) {
return self::SUCCESS;
}
$process = new Process(['pm2']);
$process->start();
$process->wait();
if ($process->getExitCode() !== 0) {
$this->components->info('PM2 is not installed.');
return self::SUCCESS;
}

$this->components->info('Restarting PM2 processes');
$process = new Process(['pm2', 'restart', 'all', '--update-env'], $this->getCwdOption(), timeout: 300);
$process->start();
Expand Down

0 comments on commit b80789a

Please sign in to comment.