aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2020-04-08 11:40:32 +0200
committerMax Kostikov <max@kostikov.co>2020-04-08 11:40:32 +0200
commitd8802e4fc8c779f18dd9ff6d15a8e507c89fa642 (patch)
tree9cc868f56a5456c59eb6e230803f2966c2ce9735 /Zotlabs
parentaf7a31cd1400a6b2f21e7c0a622ab448179f0ef8 (diff)
parent2c8a243ece79af05e30b1926bd372698d30f7aab (diff)
downloadvolse-hubzilla-d8802e4fc8c779f18dd9ff6d15a8e507c89fa642.tar.gz
volse-hubzilla-d8802e4fc8c779f18dd9ff6d15a8e507c89fa642.tar.bz2
volse-hubzilla-d8802e4fc8c779f18dd9ff6d15a8e507c89fa642.zip
Merge branch 'dev' into 'dev'
Fix process id disclouse See merge request hubzilla/core!1848
Diffstat (limited to 'Zotlabs')
-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'));