@cryptotaxi247 / netdata-1 / commits / 4610ff089

cleanup hosts - leftover code (#19603)

Costa Tsaousis committed Feb 10, 2025 at 10:41 UTC 4610ff0891495233bda8b5caa961e090a41f1058
1 file changed +9 -13
src/database/rrdhost.c
+9 -13
@@ -814,26 +814,22 @@ void rrdhost_cleanup_data_collection_and_health(RRDHOST *host) {
814 void rrdhost_free___while_having_rrd_wrlock(RRDHOST *host) {
815 if(!host) return;
816
817 - if (netdata_exit) {
818 - nd_log(NDLS_DAEMON, NDLP_DEBUG,
819 - "RRD: 'host:%s' freeing memory...",
820 - rrdhost_hostname(host));
817 + nd_log(NDLS_DAEMON, NDLP_DEBUG,
818 + "RRD: 'host:%s' freeing memory...",
819 + rrdhost_hostname(host));
820
822 - // ------------------------------------------------------------------------
823 - // first remove it from the indexes, so that it will not be discoverable
821 + // ------------------------------------------------------------------------
822 + // first remove it from the indexes, so that it will not be discoverable
823
825 - rrdhost_index_del_hostname(host);
826 - rrdhost_index_del_by_guid(host);
824 + rrdhost_index_del_hostname(host);
825 + rrdhost_index_del_by_guid(host);
826
828 - if (host->prev)
829 - DOUBLE_LINKED_LIST_REMOVE_ITEM_UNSAFE(localhost, host, prev, next);
830 - }
827 + if (host->prev)
828 + DOUBLE_LINKED_LIST_REMOVE_ITEM_UNSAFE(localhost, host, prev, next);
829
830 // ------------------------------------------------------------------------
831
832 rrdhost_cleanup_data_collection_and_health(host);
835 - if (!netdata_exit)
836 - return;
833
834 // ------------------------------------------------------------------------
835 // free it