提交 2aa6c666 编写于 作者: F fang

repeat insertation if failed, report failure when inserting 5 times

上级 c9ebc4e3
...@@ -660,7 +660,12 @@ void *readMetric(void *sarg) { ...@@ -660,7 +660,12 @@ void *readMetric(void *sarg) {
} }
void queryDB(TAOS *taos, char *command) { void queryDB(TAOS *taos, char *command) {
if (taos_query(taos, command) != 0) { int i = 5;
while (i > 0) {
if (taos_query(taos, command) == 0) break;
i--;
}
if (i == 0) {
fprintf(stderr, "Failed to run %s, reason: %s\n", command, taos_errstr(taos)); fprintf(stderr, "Failed to run %s, reason: %s\n", command, taos_errstr(taos));
taos_close(taos); taos_close(taos);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册