diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index ad6d9df995955f64a99cb809e31875b1337622ff..c929c81eaab5a2ff31da082b873e5f67d0a0b713 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -660,7 +660,12 @@ void *readMetric(void *sarg) { } 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)); taos_close(taos); exit(EXIT_FAILURE);