Skip to content

Commit

Permalink
Add flag for force-starting new process groups (even if they don't au…
Browse files Browse the repository at this point in the history
…tostart).
  • Loading branch information
BusterNeece committed Jul 3, 2024
1 parent 2c84202 commit ef53807
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/Supervisor.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ public function getProcess(string $name): ProcessInterface
*/
public function reloadAndApplyConfig(
bool $wait = true,
bool $stopModifiedGroups = true
bool $stopModifiedGroups = true,
bool $startNewProcesses = true
): ReloadResultInterface {
$reloadResult = ReloadResult::fromReloadConfig(
$this->reloadConfig()
Expand All @@ -188,6 +189,10 @@ public function reloadAndApplyConfig(
}

$this->addProcessGroup($group);

if ($startNewProcesses) {
$this->startProcessGroup($group);
}
}
}

Expand All @@ -197,6 +202,10 @@ public function reloadAndApplyConfig(

foreach ($reloadAdded as $group) {
$this->addProcessGroup($group);

if ($startNewProcesses) {
$this->startProcessGroup($group);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/SupervisorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ public function getProcess(string $name): ProcessInterface;
*
* @param bool $wait Wait for processes to stop before continuing execution.
* @param bool $stopModifiedGroups Fully stop all modified groups.
* @param bool $startNewProcesses Start all processes in the process group.
*
* @throws SupervisorException
*
* @return ReloadResultInterface
*/
public function reloadAndApplyConfig(
bool $wait = true,
bool $stopModifiedGroups = true
bool $stopModifiedGroups = true,
bool $startNewProcesses = true
): ReloadResultInterface;
}

0 comments on commit ef53807

Please sign in to comment.