fix: reserve log file name
This commit is contained in:
parent
f1fa948594
commit
db44febadf
|
@ -289,15 +289,14 @@ static void taosReserveOldLog(char *oldName, char *keepName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void taosKeepOldLog(char *oldName) {
|
static void taosKeepOldLog(char *oldName) {
|
||||||
if (oldName[0] == '\0') goto _end;
|
if (oldName[0] != 0) {
|
||||||
|
char compressFileName[LOG_FILE_NAME_LEN + 20];
|
||||||
char compressFileName[LOG_FILE_NAME_LEN + 20];
|
snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.gz", oldName);
|
||||||
snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.gz", oldName);
|
if (taosCompressFile(oldName, compressFileName) == 0) {
|
||||||
if (taosCompressFile(oldName, compressFileName) == 0) {
|
(void)taosRemoveFile(oldName);
|
||||||
(void)taosRemoveFile(oldName);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_end:
|
|
||||||
if (tsLogKeepDays > 0) {
|
if (tsLogKeepDays > 0) {
|
||||||
taosRemoveOldFiles(tsLogDir, tsLogKeepDays);
|
taosRemoveOldFiles(tsLogDir, tsLogKeepDays);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue