aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon')
-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..bce512b6d 100644
--- a/Zotlabs/Daemon/Expire.php
+++ b/Zotlabs/Daemon/Expire.php
@@ -9,6 +9,13 @@ class Expire {
cli_startup();
+ if ($pid = get_xconfig(0, 'expire', 'procid', false)) {
+ logger('Expire: procedure already run with PID ' . $pid);
+ return;
+ }
+
+ set_xconfig(0, 'expire', 'procid', getmypid());
+
// perform final cleanup on previously delete items
$r = q("select id from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
@@ -90,5 +97,7 @@ class Expire {
logger('Expire: sys: done', LOGGER_DEBUG);
}
+
+ del_xconfig(0, 'expire', 'procid');
}
}