mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 05:02:40 +00:00
Fix up hangup signal handling
This commit is contained in:
parent
37c58e186a
commit
b8ac646d22
3 changed files with 6 additions and 3 deletions
|
@ -45,7 +45,7 @@ class Service {
|
|||
do {
|
||||
sleep((int) max(0, $t->getTimestamp() - time()));
|
||||
pcntl_signal_dispatch();
|
||||
if ($this->hangup) {
|
||||
if ($this->reload) {
|
||||
$this->reload();
|
||||
}
|
||||
} while ($this->loop && $t->getTimestamp() > time());
|
||||
|
@ -57,9 +57,10 @@ class Service {
|
|||
|
||||
public function reload(): void {
|
||||
$this->reload = false;
|
||||
unset(Arsse::$user, Arsse::$db, Arsse::$conf, Arsse::$lang, Arsse::$obj, $this->drv);
|
||||
Arsse::$user = Arsse::$db = Arsse::$conf = Arsse::$lang = Arsse::$obj = $this->drv = null;
|
||||
Arsse::bootstrap();
|
||||
$this->__construct();
|
||||
fwrite(\STDERR, Arsse::$lang->msg("Service.Reload").\PHP_EOL);
|
||||
}
|
||||
|
||||
public function checkIn(): bool {
|
||||
|
@ -126,6 +127,6 @@ class Service {
|
|||
*
|
||||
* @codeCoverageIgnore */
|
||||
protected function sigHup(int $signo): void {
|
||||
$this->hangup = true;
|
||||
$this->reload = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
return [
|
||||
'CLI.Auth.Success' => 'Authentication successful',
|
||||
'CLI.Auth.Failure' => 'Authentication failed',
|
||||
'Service.Reload' => 'Configuration reloaded',
|
||||
|
||||
'API.Miniflux.DefaultCategoryName' => "All",
|
||||
'API.Miniflux.ImportSuccess' => 'Feeds imported successfully',
|
||||
|
|
|
@ -12,6 +12,7 @@ const DOCROOT = BASE."tests".DIRECTORY_SEPARATOR."docroot".DIRECTORY_SEPARATOR;
|
|||
ini_set("memory_limit", "-1");
|
||||
ini_set("zend.assertions", "1");
|
||||
ini_set("assert.exception", "true");
|
||||
// FIXME: Workaround for a bug in PCRE2 10.37
|
||||
ini_set("pcre.jit", "0");
|
||||
// FIXME: This is required by a dependency of Picofeed
|
||||
error_reporting(\E_ALL & ~\E_DEPRECATED);
|
||||
|
|
Loading…
Reference in a new issue