From 1b998f06a4f809e446a1ad21baaf26fa2591b974 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 25 Mar 2021 21:00:52 +0800 Subject: [PATCH] [TD-3472] : fix query times determination miss. (#5576) Co-authored-by: Shuduo Sang --- src/kit/taosdemo/taosdemo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index ebb7fba786..a981129bcd 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -5428,7 +5428,10 @@ static void *superQueryProcess(void *sarg) { int64_t st = 0; int64_t et = 0; - while (1) { + + int queryTimes = g_args.query_times; + + while(queryTimes --) { if (g_queryInfo.superQueryInfo.rate && (et - st) < (int64_t)g_queryInfo.superQueryInfo.rate*1000) { taosMsleep(g_queryInfo.superQueryInfo.rate*1000 - (et - st)); // ms @@ -5498,7 +5501,7 @@ static void *subQueryProcess(void *sarg) { int64_t et = (int64_t)g_queryInfo.subQueryInfo.rate*1000; int queryTimes = g_args.query_times; - while (queryTimes --) { + while(queryTimes --) { if (g_queryInfo.subQueryInfo.rate && (et - st) < (int64_t)g_queryInfo.subQueryInfo.rate*1000) { taosMsleep(g_queryInfo.subQueryInfo.rate*1000 - (et - st)); // ms -- GitLab