修改health check module初始化的顺序,并修改日志级别

This commit is contained in:
luwenpeng
2023-02-24 15:41:57 +08:00
parent b06c0b77e1
commit 586fb056a6
2 changed files with 5 additions and 5 deletions

View File

@@ -107,7 +107,7 @@ int health_check_session_add(int session_id, const struct health_check *policy)
bfd_vtysh_connect(&client); bfd_vtysh_connect(&client);
ret = bfd_vtysh_add_dev(&client, policy->address, policy->retires, policy->interval_ms); ret = bfd_vtysh_add_dev(&client, policy->address, policy->retires, policy->interval_ms);
if (ret != 0) { if (ret != 0) {
LOG_DEBUG("bfd vtysh add dev address [%s] failed!", policy->address); LOG_ERROR("bfd vtysh add dev address [%s] failed!", policy->address);
bfd_vtysh_close(&client); bfd_vtysh_close(&client);
return -1; return -1;
} }
@@ -145,7 +145,7 @@ int health_check_session_del(int session_id)
bfd_vtysh_connect(&client); bfd_vtysh_connect(&client);
ret = bfd_vtysh_del_dev(&client, tmp->policy.address); ret = bfd_vtysh_del_dev(&client, tmp->policy.address);
if (ret != 0) { if (ret != 0) {
LOG_DEBUG("bfd vtysh delete dev address [%s] failed!", tmp->policy.address); LOG_ERROR("bfd vtysh delete dev address [%s] failed!", tmp->policy.address);
bfd_vtysh_close(&client); bfd_vtysh_close(&client);
return -1; return -1;
} }
@@ -221,7 +221,7 @@ static int get_mac_by_addr(char *addr, uint8_t *buf)
saved_errno = errno; saved_errno = errno;
ret = ioctl(sfd, SIOCGARP, &arp_req); ret = ioctl(sfd, SIOCGARP, &arp_req);
if (ret < 0) { if (ret < 0) {
LOG_DEBUG("Get ARP entry failed : %s\n", strerror(errno)); LOG_ERROR("Get ARP entry failed : %s\n", strerror(errno));
return -1; return -1;
} }
errno = saved_errno; errno = saved_errno;

View File

@@ -67,6 +67,8 @@ int main(int argc, char **argv)
return -1; return -1;
} }
health_check_session_init(profile);
struct sce_ctx *ctx = sce_ctx_create(profile); struct sce_ctx *ctx = sce_ctx_create(profile);
if (ctx == NULL) if (ctx == NULL)
{ {
@@ -74,8 +76,6 @@ 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;