diff options
author | Mario <mario@mariovavti.com> | 2021-10-06 08:33:10 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-10-06 08:33:10 +0000 |
commit | b5fed08dd41d64a24e4e5bdae2a59c1bcf2fec80 (patch) | |
tree | 8e2775716e4208b7ce62a47a00f1a7ec9c013c8d /Zotlabs/Daemon | |
parent | 9bfcaf26695190e715b221ca5e78e8d7894d62af (diff) | |
download | volse-hubzilla-b5fed08dd41d64a24e4e5bdae2a59c1bcf2fec80.tar.gz volse-hubzilla-b5fed08dd41d64a24e4e5bdae2a59c1bcf2fec80.tar.bz2 volse-hubzilla-b5fed08dd41d64a24e4e5bdae2a59c1bcf2fec80.zip |
really de-duplicate entries for dead hubs
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index d1b637384..44f71e1df 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -538,9 +538,7 @@ class Notifier { foreach ($hubs as $hub) { if (isset($hub['site_dead']) && intval($hub['site_dead'])) { - if(!in_array($hub, $dead)) { - $dead[] = $hub; - } + $dead[] = $hub; continue; } @@ -679,20 +677,25 @@ class Notifier { do_delivery(self::$deliveries); } - if ($dead) { + if ($dead && is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) { + $dead_hosts_processed = []; foreach ($dead as $deceased) { - if (is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) { - 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('undeliverable/unresponsive site'), - dbesc(datetime_convert()), - dbesc(self::$channel['channel_hash']), - dbesc(new_uuid()) - ); + if(in_array($deceased['hubloc_host'], $dead_hosts_processed)) { + continue; + } + $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('undeliverable/unresponsive site'), + dbesc(datetime_convert()), + dbesc(self::$channel['channel_hash']), + dbesc(new_uuid()) + ); + if($r) { + $dead_hosts_processed[] = $deceased['hubloc_host']; } } } |