bugfix: sf_status与health check module的状态同步

This commit is contained in:
luwenpeng
2023-03-15 17:59:56 +08:00
parent e6f729ca72
commit 56de9db921

View File

@@ -252,7 +252,6 @@ int health_check_session_del(uint64_t session_id, int profile_id)
struct bfd_vtysh_client client; struct bfd_vtysh_client client;
struct session_iterm *tmp = NULL; struct session_iterm *tmp = NULL;
sf_status_delete(g_sf_status, profile_id);
tmp = health_check_get_iterm_by_id(session_id); tmp = health_check_get_iterm_by_id(session_id);
if (!tmp) { if (!tmp) {
LOG_DEBUG("health check session table delete: session id [%lu] not exists", session_id); LOG_DEBUG("health check session table delete: session id [%lu] not exists", session_id);
@@ -276,6 +275,7 @@ int health_check_session_del(uint64_t session_id, int profile_id)
end: end:
pthread_rwlock_wrlock(&g_handle.rwlock); pthread_rwlock_wrlock(&g_handle.rwlock);
HASH_DELETE(hh1, g_handle.root_by_id, tmp); HASH_DELETE(hh1, g_handle.root_by_id, tmp);
sf_status_delete(g_sf_status, profile_id);
pthread_rwlock_unlock(&g_handle.rwlock); pthread_rwlock_unlock(&g_handle.rwlock);
free(tmp); free(tmp);
tmp = NULL; tmp = NULL;