change trim cron
This commit is contained in:
parent
ed6f542a3e
commit
bf48419dff
|
@ -20,7 +20,9 @@ static void *dmStatusThreadFp(void *param) {
|
|||
SDnodeMgmt *pMgmt = param;
|
||||
int64_t lastTime = taosGetTimestampMs();
|
||||
setThreadName("dnode-status");
|
||||
|
||||
|
||||
const static int16_t TRIM_FREQ = 30;
|
||||
int32_t trimCount = 0;
|
||||
while (1) {
|
||||
taosMsleep(200);
|
||||
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
||||
|
@ -28,9 +30,13 @@ static void *dmStatusThreadFp(void *param) {
|
|||
int64_t curTime = taosGetTimestampMs();
|
||||
float interval = (curTime - lastTime) / 1000.0f;
|
||||
if (interval >= tsStatusInterval) {
|
||||
taosMemoryTrim(0);
|
||||
dmSendStatusReq(pMgmt);
|
||||
lastTime = curTime;
|
||||
|
||||
trimCount = (trimCount + 1) % TRIM_FREQ;
|
||||
if (trimCount == 0) {
|
||||
taosMemoryTrim(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue