chore: code optimization
This commit is contained in:
parent
ec4b4923e8
commit
8225c3fd9b
|
@ -32,6 +32,7 @@ static void *dmStatusThreadFp(void *param) {
|
||||||
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
||||||
|
|
||||||
int64_t curTime = taosGetTimestampMs();
|
int64_t curTime = taosGetTimestampMs();
|
||||||
|
if (curTime < lastTime) lastTime = curTime;
|
||||||
float interval = (curTime - lastTime) / 1000.0f;
|
float interval = (curTime - lastTime) / 1000.0f;
|
||||||
if (interval >= tsStatusInterval) {
|
if (interval >= tsStatusInterval) {
|
||||||
dmSendStatusReq(pMgmt);
|
dmSendStatusReq(pMgmt);
|
||||||
|
@ -62,6 +63,7 @@ static void *dmMonitorThreadFp(void *param) {
|
||||||
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
||||||
|
|
||||||
int64_t curTime = taosGetTimestampMs();
|
int64_t curTime = taosGetTimestampMs();
|
||||||
|
if (curTime < lastTime) lastTime = curTime;
|
||||||
float interval = (curTime - lastTime) / 1000.0f;
|
float interval = (curTime - lastTime) / 1000.0f;
|
||||||
if (interval >= tsMonitorInterval) {
|
if (interval >= tsMonitorInterval) {
|
||||||
(*pMgmt->sendMonitorReportFp)();
|
(*pMgmt->sendMonitorReportFp)();
|
||||||
|
|
Loading…
Reference in New Issue