mirror of
https://github.com/friendica/friendica
synced 2024-12-23 02:40:17 +00:00
Fixes: (#5447)
- rewrote to first check if PID file is readable, then if found load it - next addition is to cast it's content to int. Any non-integer content will result in 0 (as I know). - Give warnings a voice! (xdebug's scream option showed a warning) - added some spaces for better readability
This commit is contained in:
parent
d1d2ee6b2f
commit
2970a976d5
1 changed files with 7 additions and 3 deletions
|
@ -65,7 +65,11 @@ if (empty($_SERVER["argv"][0])) {
|
||||||
die("Unexpected script behaviour. This message should never occur.\n");
|
die("Unexpected script behaviour. This message should never occur.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$pid = @file_get_contents($pidfile);
|
$pid = null;
|
||||||
|
|
||||||
|
if (is_readable($pidfile)) {
|
||||||
|
$pid = intval(file_get_contents($pidfile));
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($pid) && in_array($mode, ["stop", "status"])) {
|
if (empty($pid) && in_array($mode, ["stop", "status"])) {
|
||||||
Config::set('system', 'worker_daemon_mode', false);
|
Config::set('system', 'worker_daemon_mode', false);
|
||||||
|
|
Loading…
Reference in a new issue