shell: limit taos_history file size
This commit is contained in:
parent
22ea676a5a
commit
3ba69ca5db
|
@ -778,12 +778,6 @@ void shellReadHistory() {
|
||||||
|
|
||||||
void shellWriteHistory() {
|
void shellWriteHistory() {
|
||||||
SShellHistory *pHistory = &shell.history;
|
SShellHistory *pHistory = &shell.history;
|
||||||
int64_t file_size;
|
|
||||||
if (taosStatFile(pHistory->file, &file_size, NULL) != 0) {
|
|
||||||
return;
|
|
||||||
} else if (file_size > SHELL_MAX_COMMAND_SIZE) {
|
|
||||||
taosRemoveFile(pHistory->file);
|
|
||||||
}
|
|
||||||
TdFilePtr pFile = taosOpenFile(pHistory->file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_STREAM | TD_FILE_APPEND);
|
TdFilePtr pFile = taosOpenFile(pHistory->file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_STREAM | TD_FILE_APPEND);
|
||||||
if (pFile == NULL) return;
|
if (pFile == NULL) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue