提交 fe7ae59d authored 作者: Thomas Mueller's avatar Thomas Mueller

Wait at most 100 ms at a time

上级 5758f584
...@@ -97,10 +97,16 @@ public class WriterThread implements Runnable { ...@@ -97,10 +97,16 @@ public class WriterThread implements Runnable {
// wait 0 mean wait forever, which is not what we want // wait 0 mean wait forever, which is not what we want
wait = Constants.MIN_WRITE_DELAY; wait = Constants.MIN_WRITE_DELAY;
} }
try { int w = wait;
Thread.sleep(wait); while (!stop && w >= 0) {
} catch (InterruptedException e) { // only wait 100 ms at a time
// ignore int n = Math.min(w, 100);
try {
Thread.sleep(n);
} catch (InterruptedException e) {
// ignore
}
w -= n;
} }
} }
databaseRef = null; databaseRef = null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论