diff options
author | Mario <mario@mariovavti.com> | 2020-04-03 10:49:57 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-04-03 10:49:57 +0200 |
commit | 898fea1e0e5b2bb3d0689a09e6f287a212108ab5 (patch) | |
tree | 03e3eee8b9cb50d6615866d21f5e9aaa2778f7f5 /Zotlabs/Daemon | |
parent | ac52bebb88306273a481b7114fe190917da49b91 (diff) | |
parent | 4b3979df04e0cba12049dced3ba037a004c324f6 (diff) | |
download | volse-hubzilla-898fea1e0e5b2bb3d0689a09e6f287a212108ab5.tar.gz volse-hubzilla-898fea1e0e5b2bb3d0689a09e6f287a212108ab5.tar.bz2 volse-hubzilla-898fea1e0e5b2bb3d0689a09e6f287a212108ab5.zip |
Merge branch 'dev' into 'dev'
Avoid multiple run of expiry procedure on large sites
See merge request hubzilla/core!1847
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/Expire.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php index 398425861..f3f42df6f 100644 --- a/Zotlabs/Daemon/Expire.php +++ b/Zotlabs/Daemon/Expire.php @@ -8,6 +8,13 @@ class Expire { static public function run($argc,$argv){ 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); + return; + } + + set_config('expire', 'procid', getmypid()); // perform final cleanup on previously delete items @@ -90,5 +97,7 @@ class Expire { logger('Expire: sys: done', LOGGER_DEBUG); } + + del_config('expire', 'procid'); } } |