提交 7a296ebb authored 作者: Andrei Tokar's avatar Andrei Tokar

add commit on closure in absence of compaction

上级 f1b35267
...@@ -1539,11 +1539,15 @@ public class Database implements DataHandler { ...@@ -1539,11 +1539,15 @@ public class Database implements DataHandler {
compactMode == CommandInterface.SHUTDOWN_DEFRAG || compactMode == CommandInterface.SHUTDOWN_DEFRAG ||
getSettings().defragAlways; getSettings().defragAlways;
if (!compactFully && !mvStore.isReadOnly()) { if (!compactFully && !mvStore.isReadOnly()) {
if (dbSettings.maxCompactTime > 0) {
try { try {
store.compactFile(dbSettings.maxCompactTime); store.compactFile(dbSettings.maxCompactTime);
} catch (Throwable t) { } catch (Throwable t) {
trace.error(t, "compactFile"); trace.error(t, "compactFile");
} }
} else {
mvStore.commit();
}
} }
store.close(compactFully); store.close(compactFully);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论