Merge pull request #2883 from taosdata/feature/td-1033
td-1033: fix high cpu usage
This commit is contained in:
commit
a63daaf77c
|
@ -235,7 +235,9 @@ static void* telemetryThread(void* param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int startAt = taosGetTimestampSec();
|
int startAt = taosGetTimestampSec();
|
||||||
struct timespec timeout = {.tv_sec = timeToWait, .tv_nsec = 0};
|
struct timespec timeout = {.tv_sec = 0, .tv_nsec = 0};
|
||||||
|
clock_gettime(CLOCK_REALTIME, &timeout);
|
||||||
|
timeout.tv_sec += timeToWait;
|
||||||
if (sem_timedwait(&tsExitSem, &timeout) == 0) {
|
if (sem_timedwait(&tsExitSem, &timeout) == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -279,4 +281,4 @@ void dnodeCleanupTelemetry() {
|
||||||
pthread_join(tsTelemetryThread, NULL);
|
pthread_join(tsTelemetryThread, NULL);
|
||||||
sem_destroy(&tsExitSem);
|
sem_destroy(&tsExitSem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue