提交 a57da3bd 编写于 作者: G Ganlin Zhao

fix: fix log not compressed when logKeepDays set to positive value

上级 70c18d44
...@@ -210,15 +210,15 @@ static void taosKeepOldLog(char *oldName) { ...@@ -210,15 +210,15 @@ static void taosKeepOldLog(char *oldName) {
(void)taosRenameFile(oldName, fileName); (void)taosRenameFile(oldName, fileName);
if (tsLogKeepDays < 0) { char compressFileName[LOG_FILE_NAME_LEN + 20];
char compressFileName[LOG_FILE_NAME_LEN + 20]; snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64 ".gz", tsLogObj.logName, fileSec);
snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64 ".gz", tsLogObj.logName, fileSec); if (taosCompressFile(fileName, compressFileName) == 0) {
if (taosCompressFile(fileName, compressFileName) == 0) { (void)taosRemoveFile(fileName);
(void)taosRemoveFile(fileName);
}
} }
taosRemoveOldFiles(tsLogDir, TABS(tsLogKeepDays)); if (tsLogKeepDays > 0) {
taosRemoveOldFiles(tsLogDir, tsLogKeepDays);
}
} }
static void *taosThreadToOpenNewFile(void *param) { static void *taosThreadToOpenNewFile(void *param) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册