diff options
author | Mario <mario@mariovavti.com> | 2021-10-06 08:43:40 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-10-06 08:43:40 +0000 |
commit | 8ac529f5aec365f6e65c3539779b62cedbd39a28 (patch) | |
tree | 25643cb9844862a7ac20ac6fd82eee698d643e9d /Zotlabs/Daemon/Notifier.php | |
parent | b5fed08dd41d64a24e4e5bdae2a59c1bcf2fec80 (diff) | |
download | volse-hubzilla-8ac529f5aec365f6e65c3539779b62cedbd39a28.tar.gz volse-hubzilla-8ac529f5aec365f6e65c3539779b62cedbd39a28.tar.bz2 volse-hubzilla-8ac529f5aec365f6e65c3539779b62cedbd39a28.zip |
simplify
Diffstat (limited to 'Zotlabs/Daemon/Notifier.php')
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 44f71e1df..368a9229d 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -529,16 +529,18 @@ class Notifier { */ - $hublist = []; // this provides an easily printable list for the logs - $dhubs = []; // delivery hubs where we store our resulting unique array - $keys = []; // array of keys to check uniquness for zot hubs - $urls = []; // array of urls to check uniqueness of hubs from other networks - $hub_env = []; // per-hub envelope so we don't broadcast the entire envelope to all - $dead = []; // known dead hubs - report them as undeliverable + $hublist = []; // this provides an easily printable list for the logs + $dhubs = []; // delivery hubs where we store our resulting unique array + $keys = []; // array of keys to check uniquness for zot hubs + $urls = []; // array of urls to check uniqueness of hubs from other networks + $hub_env = []; // per-hub envelope so we don't broadcast the entire envelope to all + $dead_hosts = []; // known dead hubs - report them as undeliverable foreach ($hubs as $hub) { if (isset($hub['site_dead']) && intval($hub['site_dead'])) { - $dead[] = $hub; + if(!in_array($hub['hubloc_host'], $dead_hosts)) { + $dead_hosts[] = $hub['hubloc_host']; + } continue; } @@ -677,26 +679,19 @@ class Notifier { do_delivery(self::$deliveries); } - if ($dead && is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) { - $dead_hosts_processed = []; - foreach ($dead as $deceased) { - if(in_array($deceased['hubloc_host'], $dead_hosts_processed)) { - continue; - } + if ($dead_hosts && is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) { + foreach ($dead_hosts as $deceased_host) { $r = q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue ) values ( '%s', '%s','%s','%s','%s','%s','%s','%s' ) ", dbesc($target_item['mid']), - dbesc($deceased['hubloc_host']), - dbesc($deceased['hubloc_host']), - dbesc($deceased['hubloc_host']), + dbesc($deceased_host), + dbesc($deceased_host), + dbesc($deceased_host), dbesc('undeliverable/unresponsive site'), dbesc(datetime_convert()), dbesc(self::$channel['channel_hash']), dbesc(new_uuid()) ); - if($r) { - $dead_hosts_processed[] = $deceased['hubloc_host']; - } } } |