BackgroundDaemon: log reload and make some...

...methods public
This commit is contained in:
Thomas Gelf 2020-06-06 22:26:56 +02:00
parent 6736e3296e
commit 6cd50fb392

View File

@ -131,6 +131,22 @@ class BackgroundDaemon
return $systemd; return $systemd;
} }
/**
* @return DaemonProcessDetails
*/
public function getProcessDetails()
{
return $this->processDetails;
}
/**
* @return DaemonProcessState
*/
public function getProcessState()
{
return $this->processState;
}
protected function initializeDb( protected function initializeDb(
DaemonProcessDetails $processDetails, DaemonProcessDetails $processDetails,
DaemonProcessState $processState, DaemonProcessState $processState,
@ -178,13 +194,14 @@ class BackgroundDaemon
$this->shutdown(); $this->shutdown();
} }
protected function reload() public function reload()
{ {
if ($this->reloading) { if ($this->reloading) {
Logger::error('Ignoring reload request, reload is already in progress'); Logger::error('Ignoring reload request, reload is already in progress');
return; return;
} }
$this->reloading = true; $this->reloading = true;
Logger::info('Going gown for reload now');
$this->setState('reloading the main process'); $this->setState('reloading the main process');
$this->daemonDb->disconnect()->then(function () { $this->daemonDb->disconnect()->then(function () {
Process::restart(); Process::restart();