diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 75ccd44977c38539000fa9888fa7ad033cc653b5..acf87f2aca5bf9d278f2af2fc345a96b497d52fc 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -274,13 +274,13 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) { SClientHbBatchRsp pRsp = {0}; if (TSDB_CODE_SUCCESS == code) { tDeserializeSClientHbBatchRsp(pMsg->pData, pMsg->len, &pRsp); - } - int32_t now = taosGetTimestampSec(); - int32_t delta = abs(now - pRsp.svrTimestamp); - if (delta > timestampDeltaLimit) { - code = TSDB_CODE_TIME_UNSYNCED; - tscError("time diff: %ds is too big", delta); + int32_t now = taosGetTimestampSec(); + int32_t delta = abs(now - pRsp.svrTimestamp); + if (delta > timestampDeltaLimit) { + code = TSDB_CODE_TIME_UNSYNCED; + tscError("time diff: %ds is too big", delta); + } } int32_t rspNum = taosArrayGetSize(pRsp.rsps);