diff options
author | Mario <mario@mariovavti.com> | 2023-05-17 13:28:23 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-05-17 13:28:23 +0000 |
commit | 65d98af24c3c7b784f7e2c95998df65901011ce3 (patch) | |
tree | d7d6a60698d7a0c3704ea55cb71c543285186b17 /Zotlabs/Daemon/Queue.php | |
parent | a57739c462a7991bf2130e8eca0c383eb276f0cd (diff) | |
parent | 62d35627f35537d0056482047e74a27ad837c3cf (diff) | |
download | volse-hubzilla-8.4.tar.gz volse-hubzilla-8.4.tar.bz2 volse-hubzilla-8.4.zip |
Merge branch '8.4RC'8.4
Diffstat (limited to 'Zotlabs/Daemon/Queue.php')
-rw-r--r-- | Zotlabs/Daemon/Queue.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php index b07fe369c..91aba831a 100644 --- a/Zotlabs/Daemon/Queue.php +++ b/Zotlabs/Daemon/Queue.php @@ -14,7 +14,7 @@ class Queue { // delete all queue items more than 3 days old // but first mark these sites dead if we haven't heard from them in a month - $oldqItems = q("select outq_posturl from outq where outq_created < %s - INTERVAL %s", + $oldqItems = q("select outq_posturl, outq_hash from outq where outq_created < %s - INTERVAL %s", db_utcnow(), db_quoteinterval('3 DAY') ); @@ -29,13 +29,13 @@ class Queue { db_quoteinterval('1 MONTH') ); } - } - logger('Removing ' . count($oldqItems) . ' old queue entries'); - q("DELETE FROM outq WHERE outq_created < %s - INTERVAL %s", - db_utcnow(), - db_quoteinterval('3 DAY') - ); + $old_hashes = ids_to_querystr($oldqItems, 'outq_hash', true); + + logger('Removing ' . count($oldqItems) . ' old queue entries'); + dbq("DELETE FROM outq WHERE outq_hash IN ($old_hashes)"); + + } $deliveries = []; @@ -47,9 +47,10 @@ class Queue { LibQueue::deliver($qItems[0]); } else { - $qItems = q("SELECT * FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s ", + $qItems = q("SELECT outq_hash FROM outq WHERE outq_scheduled < %s ", db_utcnow() ); + if ($qItems) { foreach ($qItems as $qItem) { $deliveries[] = $qItem['outq_hash']; |