From cbf8c4bdb274f8d9c326961b9d0bf0c2a2ac35a0 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 16 Feb 2023 11:16:44 +0000 Subject: more queue updates from streams and remove a hz_syslog --- Zotlabs/Daemon/Queue.php | 2 +- Zotlabs/Lib/Libsync.php | 4 ++-- Zotlabs/Lib/Queue.php | 23 ++++++++++++----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php index 6f7f8abac..b07fe369c 100644 --- a/Zotlabs/Daemon/Queue.php +++ b/Zotlabs/Daemon/Queue.php @@ -54,7 +54,7 @@ class Queue { foreach ($qItems as $qItem) { $deliveries[] = $qItem['outq_hash']; } - do_delivery($deliveries); + do_delivery($deliveries, true); } } } diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index b0ce7cd12..d52b501e4 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -998,12 +998,12 @@ class Libsync { } } - // get rid of any hubs we have for this channel which weren't reported. + // get rid of any hublocs we have for this channel which weren't reported. if ($xisting) { foreach ($xisting as $x) { if (!array_key_exists('updated', $x)) { - hz_syslog('Deleting unreferenced hub location ' . $x['hubloc_addr']); + logger('Deleting unreferenced hub location ' . $x['hubloc_addr']); q("update hubloc set hubloc_deleted = 1, hubloc_updated = '%s' where hubloc_id_url = '%s'", dbesc(datetime_convert()), dbesc($x['hubloc_id_url']) diff --git a/Zotlabs/Lib/Queue.php b/Zotlabs/Lib/Queue.php index 23691408a..c48b59c86 100644 --- a/Zotlabs/Lib/Queue.php +++ b/Zotlabs/Lib/Queue.php @@ -166,17 +166,18 @@ class Queue { $y = q("select site_update, site_dead from site where site_url = '%s' ", dbesc($base) ); - if($y) { - if(intval($y[0]['site_dead'])) { - self::remove_by_posturl($outq['outq_posturl']); - logger('dead site ignored ' . $base); - return; - } - if($y[0]['site_update'] < datetime_convert('UTC','UTC','now - 1 month')) { - self::update($outq['outq_hash'], 10); - logger('immediate delivery deferred for site ' . $base); - return; - } + + // Don't bother delivering if the site is dead. + // And if we haven't heard from the site in over a month - let them through but 3 strikes you're out. + if ($y && (intval($y[0]['site_dead']) || ($y[0]['site_update'] < datetime_convert('UTC', 'UTC', 'now - 1 month') && $outq['outq_priority'] > 20 ))) { + q("update dreport set dreport_result = '%s' where dreport_queue = '%s'", + dbesc('site dead'), + dbesc($outq['outq_hash']) + ); + + self::remove_by_posturl($outq['outq_posturl']); + logger('dead site ignored ' . $base); + return; } else { -- cgit v1.2.3