Skip to content

Commit

Permalink
add todo to reload custom process
Browse files Browse the repository at this point in the history
  • Loading branch information
hhxsv5 committed Nov 11, 2019
1 parent 4a48b63 commit f693149
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Console/Portal.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,23 @@ public function reload()
$this->error("Swoole [PID={$pid}] is reloaded failed.");
}

// Reload custom processes
$pidFile = dirname($pidFile) . '/laravels-custom-processes.pid';
if (file_exists($pidFile)) {
$pids = (array)explode("\n", trim(file_get_contents($pidFile)));
foreach ($pids as $pid) {
if (!$pid || !self::kill($pid, 0)) {
$this->error("Custom process[PID={$pid}] does not exist, or permission denied.");
continue;
}

if (self::kill($pid, SIGUSR1)) {
$this->info("Custom process[PID={$pid}] is reloaded.");
} else {
$this->error("Custom process[PID={$pid}] is reloaded failed.");
}
}
}
// TODO: next release: Reload custom processes
// $pidFile = dirname($pidFile) . '/laravels-custom-processes.pid';
// if (file_exists($pidFile)) {
// $pids = (array)explode("\n", trim(file_get_contents($pidFile)));
// foreach ($pids as $pid) {
// if (!$pid || !self::kill($pid, 0)) {
// $this->error("Custom process[PID={$pid}] does not exist, or permission denied.");
// continue;
// }
//
// if (self::kill($pid, SIGUSR1)) {
// $this->info("Custom process[PID={$pid}] is reloaded.");
// } else {
// $this->error("Custom process[PID={$pid}] is reloaded failed.");
// }
// }
// }

// Reload timer process
if (!empty($config['server']['timer']['enable'])) {
Expand Down

0 comments on commit f693149

Please sign in to comment.