shell: limit taos_history file size and rows
This commit is contained in:
parent
1e4dae929c
commit
912652c2e6
|
@ -766,12 +766,10 @@ void shellReadHistory() {
|
||||||
endIndex = pHistory->hend;
|
endIndex = pHistory->hend;
|
||||||
}
|
}
|
||||||
for (int32_t i = (pHistory->hend + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE; i != endIndex;) {
|
for (int32_t i = (pHistory->hend + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE; i != endIndex;) {
|
||||||
printf("%d ",i);
|
|
||||||
taosFprintfFile(pFile, "%s\n", pHistory->hist[i]);
|
taosFprintfFile(pFile, "%s\n", pHistory->hist[i]);
|
||||||
i = (i + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE;
|
i = (i + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE;
|
||||||
}
|
}
|
||||||
taosFprintfFile(pFile, "%s\n", pHistory->hist[endIndex]);
|
taosFprintfFile(pFile, "%s\n", pHistory->hist[endIndex]);
|
||||||
printf("\n");
|
|
||||||
taosFsyncFile(pFile);
|
taosFsyncFile(pFile);
|
||||||
taosCloseFile(&pFile);
|
taosCloseFile(&pFile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue