aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Expire.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon/Expire.php')
-rw-r--r--Zotlabs/Daemon/Expire.php9
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');
}
}