summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorpengxuanzheng <[email protected]>2021-09-27 18:49:27 +0800
committerpengxuanzheng <[email protected]>2021-10-11 11:00:56 +0800
commit8c49f4d2c244a6beda066f0956ac2fe048c98812 (patch)
tree150599233a0150809f12e2ede92dbb42e5c77721 /example
parent7b6a1281cf44b0b205ec286bed5c4d0b79fc8527 (diff)
🐞 fix(TSG-7599): hos client 初始化失败,定期尝试重连hos服务
Diffstat (limited to 'example')
-rw-r--r--example/demo/hos_write_demo.cpp6
-rw-r--r--example/performance/HosClientPerformance.cpp3
2 files changed, 4 insertions, 5 deletions
diff --git a/example/demo/hos_write_demo.cpp b/example/demo/hos_write_demo.cpp
index 6cdc1aff..95402a17 100644
--- a/example/demo/hos_write_demo.cpp
+++ b/example/demo/hos_write_demo.cpp
@@ -96,14 +96,14 @@ int main(int argc, char *argv[])
printf("hos_init_instance start ...\n");
hos_instance = hos_get_instance();
- if (hos_instance->result == false)
+ if (hos_instance == NULL)
{
hos_instance = hos_init_instance(conf_file, module_name, 1, bucket);
}
- if (hos_instance->result == false)
+ if (hos_instance == NULL)
{
printf("error:hos_init_instance\n");
- printf("error:%s", hos_instance->error_message);
+ printf("error:[%d]%s", hos_get_init_instance_errorcode, hos_get_init_instance_errormsg);
return -1;
}
printf("hos_init_instance success ... \n");
diff --git a/example/performance/HosClientPerformance.cpp b/example/performance/HosClientPerformance.cpp
index 244c16c0..fbc95790 100644
--- a/example/performance/HosClientPerformance.cpp
+++ b/example/performance/HosClientPerformance.cpp
@@ -15,7 +15,6 @@ extern "C"
#include<sys/stat.h>
#include<math.h>
#include<netinet/in.h>
-#include<zlog.h>
}
#include"../../src/hos_client.h"
#include "MESA_handle_logger.h"
@@ -474,7 +473,7 @@ int main(int argc, char *argv[])
hos_instance hos_instance = hos_init_instance(conf_path, module, thread_sum, bucket);
if (hos_instance == NULL)
{
- printf("error:hos_client_handle\n %s\n", hos_instance->error_message);
+ printf("error:hos_client_handle\n error:[%d]%s\n", hos_get_init_instance_errorcode(), hos_get_init_instance_errormsg());
fclose(log);
return -1;
}