提交 912652c2 编写于 作者: wafwerar's avatar wafwerar

shell: limit taos_history file size and rows

上级 1e4dae92
......@@ -766,12 +766,10 @@ void shellReadHistory() {
endIndex = pHistory->hend;
}
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]);
i = (i + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE;
}
taosFprintfFile(pFile, "%s\n", pHistory->hist[endIndex]);
printf("\n");
taosFsyncFile(pFile);
taosCloseFile(&pFile);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册