From 3372fb0761353f646ae2b7bd168650eea5fd6211 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Wed, 8 Apr 2020 11:31:17 +0200 Subject: Fix process id disclouse --- Zotlabs/Daemon/Expire.php | 10 ++++++---- 1 file 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')); -- cgit v1.2.3