fix: logFileHandle NULL

This commit is contained in:
factosea 2024-04-03 15:29:08 +08:00
parent a3bcd9e9c9
commit ad1c474dc6
1 changed files with 6 additions and 4 deletions

View File

@ -242,6 +242,7 @@ void taosCloseLog() {
taosMemoryFreeClear(tsLogObj.logHandle->buffer);
taosThreadMutexDestroy(&tsLogObj.logMutex);
taosMemoryFreeClear(tsLogObj.logHandle);
tsLogObj.logHandle = NULL;
}
}
@ -347,10 +348,11 @@ void taosResetLog() {
// force create a new log file
tsLogObj.lines = tsNumOfLogLines + 10;
taosOpenNewLogFile();
uInfo("==================================");
uInfo(" reset log file ");
if (tsLogObj.logHandle) {
taosOpenNewLogFile();
uInfo("==================================");
uInfo(" reset log file ");
}
}
static bool taosCheckFileIsOpen(char *logFileName) {