aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-04-14 09:21:33 +0200
committerMario Vavti <mario@mariovavti.com>2023-04-14 09:21:33 +0200
commitd8811b499d5aa2559ec13862a27f70404206e0c5 (patch)
tree5dd68237e02554aa094462fb026fc366ca607799 /Zotlabs
parent20f4538db4fdfe74c060670caf46a754f856313e (diff)
downloadvolse-hubzilla-d8811b499d5aa2559ec13862a27f70404206e0c5.tar.gz
volse-hubzilla-d8811b499d5aa2559ec13862a27f70404206e0c5.tar.bz2
volse-hubzilla-d8811b499d5aa2559ec13862a27f70404206e0c5.zip
improved item_expire()
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Expire.php7
-rw-r--r--Zotlabs/Lib/QueueWorker.php7
2 files changed, 9 insertions, 5 deletions
diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php
index 5d9f14b28..84a606dc2 100644
--- a/Zotlabs/Daemon/Expire.php
+++ b/Zotlabs/Daemon/Expire.php
@@ -32,7 +32,6 @@ class Expire {
}
// physically remove anything that has been deleted for more than two months
- /** @FIXME - this is a wretchedly inefficient query */
q("delete from item where item_pending_remove = 1 and changed < %s - INTERVAL %s",
db_utcnow(),
@@ -59,8 +58,8 @@ class Expire {
continue;
// service class default (if non-zero) over-rides the site default
-
$service_class_expire = service_class_fetch($rr['channel_id'], 'expire_days');
+
if (intval($service_class_expire))
$channel_expire = $service_class_expire;
else
@@ -85,7 +84,6 @@ class Expire {
// this should probably just fetch the channel_expire_days from the sys channel,
// but there's no convenient way to set it.
-
$expire_days = get_config('system', 'sys_expire_days');
if ($expire_days === false)
$expire_days = 30;
@@ -96,8 +94,9 @@ class Expire {
logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
- if ($expire_days)
+ if ($expire_days) {
item_expire($x['channel_id'], $expire_days, $commented_days);
+ }
logger('Expire: sys: done', LOGGER_DEBUG);
}
diff --git a/Zotlabs/Lib/QueueWorker.php b/Zotlabs/Lib/QueueWorker.php
index a1c13ef8a..1c74b42d8 100644
--- a/Zotlabs/Lib/QueueWorker.php
+++ b/Zotlabs/Lib/QueueWorker.php
@@ -24,7 +24,8 @@ class QueueWorker {
// Exceptions for processtimeout ($workermaxage) value.
// Currently the value is overriden with 3600 seconds (1h).
public static $long_running_cmd = [
- 'Queue'
+ 'Queue',
+ 'Expire'
];
private static function qstart() {
@@ -147,6 +148,10 @@ class QueueWorker {
);
if ($r) {
+ // TODO: some long running services store their pid in config.procid.daemon
+ // we could possibly check if a pid exist and check if the process is still alive
+ // prior to reseting workerq_reservationid
+
$ids = ids_to_querystr($r, 'workerq_id');
$u = dbq("update workerq set workerq_reservationid = null where workerq_id in ($ids)");
}