提交 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 {
// wait 0 mean wait forever, which is not what we want
wait = Constants.MIN_WRITE_DELAY;
}
try {
Thread.sleep(wait);
} catch (InterruptedException e) {
// ignore
int w = wait;
while (!stop && w >= 0) {
// only wait 100 ms at a time
int n = Math.min(w, 100);
try {
Thread.sleep(n);
} catch (InterruptedException e) {
// ignore
}
w -= n;
}
}
databaseRef = null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论