初始化health check module

This commit is contained in:
luwenpeng
2023-02-22 20:32:37 +08:00
committed by wangmenglan
parent 7ae1a79e8a
commit 7acfa8d221
3 changed files with 5 additions and 3 deletions

View File

@@ -32,8 +32,6 @@ int health_check_session_set_status(int session_id, int is_active);
// return -1 : key not exist // return -1 : key not exist
int health_check_session_get_mac(int session_id, char *mac_buff); int health_check_session_get_mac(int session_id, char *mac_buff);
void health_check_session_foreach();
#ifdef __cpluscplus #ifdef __cpluscplus
} }
#endif #endif

View File

@@ -52,6 +52,7 @@ char gateway_address[HC_LOCAL_ADDRESS_LEN];
uint8_t default_gw_mac[HC_MAC_LEN]; uint8_t default_gw_mac[HC_MAC_LEN];
static int get_mac_by_addr(char *addr, uint8_t *buf); static int get_mac_by_addr(char *addr, uint8_t *buf);
static int health_check_session_foreach();
static struct session_iterm *health_check_get_iterm_by_id(int session_id) static struct session_iterm *health_check_get_iterm_by_id(int session_id)
{ {
@@ -266,7 +267,7 @@ static void *_health_check_session_foreach(void *arg)
bfd_vtysh_close(&client); bfd_vtysh_close(&client);
} }
int health_check_session_foreach() static int health_check_session_foreach()
{ {
pthread_t pid; pthread_t pid;
pthread_create(&pid, NULL, _health_check_session_foreach, NULL); pthread_create(&pid, NULL, _health_check_session_foreach, NULL);

View File

@@ -6,6 +6,7 @@
#include "sce.h" #include "sce.h"
#include "log.h" #include "log.h"
#include "utils.h" #include "utils.h"
#include "health_check.h"
#include "global_metrics.h" #include "global_metrics.h"
static void sig_handler(int signo) static void sig_handler(int signo)
@@ -73,6 +74,8 @@ int main(int argc, char **argv)
return -1; return -1;
} }
health_check_session_init(profile);
for (int i = 0; i < ctx->nr_worker_threads; i++) for (int i = 0; i < ctx->nr_worker_threads; i++)
{ {
ctx->work_threads[i].tid = 0; ctx->work_threads[i].tid = 0;