aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2020-04-08 11:31:17 +0200
committerMax Kostikov <max@kostikov.co>2020-04-08 11:31:17 +0200
commit3372fb0761353f646ae2b7bd168650eea5fd6211 (patch)
tree34837e436d5186fbe9f459eceb379335dcd18c70 /Zotlabs/Daemon
parentc136c142b8148abe75696ca0076a107f04e74d30 (diff)
downloadvolse-hubzilla-3372fb0761353f646ae2b7bd168650eea5fd6211.tar.gz
volse-hubzilla-3372fb0761353f646ae2b7bd168650eea5fd6211.tar.bz2
volse-hubzilla-3372fb0761353f646ae2b7bd168650eea5fd6211.zip
Fix process id disclouse
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r--Zotlabs/Daemon/Expire.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php
index f3f42df6f..a688d6f97 100644
--- a/Zotlabs/Daemon/Expire.php
+++ b/Zotlabs/Daemon/Expire.php
@@ -9,12 +9,14 @@ class Expire {
cli_startup();
- if ($pid = get_config('expire', 'procid', false) && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) {
- logger('Expire: procedure already run with PID ' . $pid, LOGGER_DEBUG);
+ $pid = get_config('expire', 'procid', false);
+ if ($pid && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) {
+ logger('Expire: procedure already run with pid ' . $pid, LOGGER_DEBUG);
return;
}
- set_config('expire', 'procid', getmypid());
+ $pid = getmypid();
+ set_config('expire', 'procid', $pid);
// perform final cleanup on previously delete items
@@ -39,7 +41,7 @@ class Expire {
if (intval(get_config('system', 'optimize_items')))
q("optimize table item");
- logger('expire: start', LOGGER_DEBUG);
+ logger('expire: start with pid ' . $pid, LOGGER_DEBUG);
$site_expire = intval(get_config('system', 'default_expire_days'));
$commented_days = intval(get_config('system','active_expire_days'));