From e6f729ca720251d065ecf145bc018d48a01a0d39 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Wed, 15 Mar 2023 17:13:09 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20TSG-14284=20SF=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84IP=E6=97=B6SCE=E6=9C=AA?= =?UTF-8?q?=E5=8F=91=E9=80=81sf=5Fstatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/health_check.cpp | 5 ++--- platform/src/sf_status.cpp | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/src/health_check.cpp b/platform/src/health_check.cpp index 1912ec6..5bb62f0 100644 --- a/platform/src/health_check.cpp +++ b/platform/src/health_check.cpp @@ -392,15 +392,14 @@ static void *_health_check_session_foreach(void *arg) is_active = 0; } + sf_status_update(g_sf_status, node->profile_id, is_active, 0); if (node->is_active != is_active) { node->is_active = is_active; if (node->is_active == 1) { - get_mac_by_addr(node->policy.address, node->mac); - sf_status_update(g_sf_status, node->profile_id, 1, 0); + get_mac_by_addr(node->policy.address, node->mac); } else { memset(node->mac, 0, sizeof(node->mac)); - sf_status_update(g_sf_status, node->profile_id, 0, 0); } } if (sleep_ms > node->policy.interval_ms) diff --git a/platform/src/sf_status.cpp b/platform/src/sf_status.cpp index a242601..cd7069d 100644 --- a/platform/src/sf_status.cpp +++ b/platform/src/sf_status.cpp @@ -155,7 +155,10 @@ void sf_status_update(struct sf_status *handle, int sf_profile_id, int sf_status HASH_FIND(hh, handle->htable, &sf_profile_id, sizeof(sf_profile_id), temp); if (temp) { - LOG_DEBUG("%s: update: sf_profile %d status %d success, elem_num %lu", LOG_TAG_SF_STATUS, sf_profile_id, sf_status, handle->htable_elem_count); + if (temp->sf_status != sf_status) + { + LOG_DEBUG("%s: update: sf_profile %d status %d success, elem_num %lu", LOG_TAG_SF_STATUS, sf_profile_id, sf_status, handle->htable_elem_count); + } temp->sf_profile_id = sf_profile_id; temp->sf_status = sf_status; temp->sf_latency = sf_latency;