refactor: fix coverity issues.
This commit is contained in:
parent
cd1089acb3
commit
edc64122cb
|
@ -400,7 +400,7 @@ TAOS* createNewTaosConnect() {
|
||||||
int32_t retryCnt = 10;
|
int32_t retryCnt = 10;
|
||||||
|
|
||||||
while (retryCnt--) {
|
while (retryCnt--) {
|
||||||
TAOS* taos = taos_connect(NULL, "root", "taosdata", NULL, 0);
|
taos = taos_connect(NULL, "root", "taosdata", NULL, 0);
|
||||||
if (NULL != taos) {
|
if (NULL != taos) {
|
||||||
return taos;
|
return taos;
|
||||||
}
|
}
|
||||||
|
@ -780,7 +780,8 @@ void loop_consume(SThreadInfo* pInfo) {
|
||||||
|
|
||||||
if (pInfo->ifCheckData) {
|
if (pInfo->ifCheckData) {
|
||||||
char filename[256] = {0};
|
char filename[256] = {0};
|
||||||
char tmpString[128];
|
memset(tmpString, 0, tListLen(tmpString));
|
||||||
|
|
||||||
// sprintf(filename, "%s/../log/consumerid_%d_%s.txt", configDir, pInfo->consumerId,
|
// sprintf(filename, "%s/../log/consumerid_%d_%s.txt", configDir, pInfo->consumerId,
|
||||||
// getCurrentTimeString(tmpString));
|
// getCurrentTimeString(tmpString));
|
||||||
sprintf(filename, "%s/../log/consumerid_%d.txt", configDir, pInfo->consumerId);
|
sprintf(filename, "%s/../log/consumerid_%d.txt", configDir, pInfo->consumerId);
|
||||||
|
@ -834,12 +835,12 @@ void loop_consume(SThreadInfo* pInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((totalRows >= pInfo->expectMsgCnt) || (totalMsgs >= pInfo->expectMsgCnt)) {
|
if ((totalRows >= pInfo->expectMsgCnt) || (totalMsgs >= pInfo->expectMsgCnt)) {
|
||||||
char tmpString[128];
|
memset(tmpString, 0, tListLen(tmpString));
|
||||||
taosFprintfFile(g_fp, "%s over than expect rows, so break consume\n", getCurrentTimeString(tmpString));
|
taosFprintfFile(g_fp, "%s over than expect rows, so break consume\n", getCurrentTimeString(tmpString));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char tmpString[128];
|
memset(tmpString, 0, tListLen(tmpString));
|
||||||
taosFprintfFile(g_fp, "%s no poll more msg when time over, break consume\n", getCurrentTimeString(tmpString));
|
taosFprintfFile(g_fp, "%s no poll more msg when time over, break consume\n", getCurrentTimeString(tmpString));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1113,7 +1114,7 @@ void omb_loop_consume(SThreadInfo* pInfo) {
|
||||||
lastTotalLenOfMsg = totalLenOfMsg;
|
lastTotalLenOfMsg = totalLenOfMsg;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char tmpString[128];
|
memset(tmpString, 0, tListLen(tmpString));
|
||||||
taosFprintfFile(g_fp, "%s no poll more msg when time over, break consume\n", getCurrentTimeString(tmpString));
|
taosFprintfFile(g_fp, "%s no poll more msg when time over, break consume\n", getCurrentTimeString(tmpString));
|
||||||
printf("%s no poll more msg when time over, break consume\n", getCurrentTimeString(tmpString));
|
printf("%s no poll more msg when time over, break consume\n", getCurrentTimeString(tmpString));
|
||||||
int64_t currentPrintTime = taosGetTimestampMs();
|
int64_t currentPrintTime = taosGetTimestampMs();
|
||||||
|
@ -1381,7 +1382,7 @@ void startOmbConsume() {
|
||||||
printf("SQL: %s\n", sql);
|
printf("SQL: %s\n", sql);
|
||||||
queryDbExec(taos, sql, NO_INSERT_TYPE);
|
queryDbExec(taos, sql, NO_INSERT_TYPE);
|
||||||
|
|
||||||
int32_t producerRate = ceil(g_stConfInfo.producerRate / g_stConfInfo.producers);
|
int32_t producerRate = ceil(((double)g_stConfInfo.producerRate) / g_stConfInfo.producers);
|
||||||
|
|
||||||
printf("==== create %d produce thread ====\n", g_stConfInfo.producers);
|
printf("==== create %d produce thread ====\n", g_stConfInfo.producers);
|
||||||
for (int32_t i = 0; i < g_stConfInfo.producers; ++i) {
|
for (int32_t i = 0; i < g_stConfInfo.producers; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue