提交 7b2c1a49 编写于 作者: R roblou

Only do flush things when the batch has something in it

上级 e8daaba2
......@@ -404,11 +404,13 @@ class BatchedCollector<T> {
}
flush(): void {
this.totalNumberCompleted += this.batchSize;
this.cb(this.batch);
this.batch = [];
this.batchSize = 0;
clearTimeout(this.timeoutHandle);
this.timeoutHandle = 0;
if (this.batchSize) {
this.totalNumberCompleted += this.batchSize;
this.cb(this.batch);
this.batch = [];
this.batchSize = 0;
clearTimeout(this.timeoutHandle);
this.timeoutHandle = 0;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册