提交 45dc8b56 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Try to close all databases in OnExitDatabaseCloser

上级 40fcee2d
......@@ -56,6 +56,7 @@ class OnExitDatabaseCloser extends Thread {
@Override
public void run() {
RuntimeException root = null;
for (Database database : DATABASES.keySet()) {
try {
database.close(true);
......@@ -69,10 +70,17 @@ class OnExitDatabaseCloser extends Thread {
// otherwise not
} catch (Throwable e2) {
e.addSuppressed(e2);
throw e;
if (root == null) {
root = e;
} else {
root.addSuppressed(e);
}
}
}
}
if (root != null) {
throw root;
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论