未验证 提交 a80a5558 编写于 作者: vpvigoss's avatar vpvigoss 提交者: GitHub

Fix bug about prepareBath in MetricsPersistentWorker #5399 (#5401)

* bugfix: when extend the scope and recommend to start with 10000 or scope greater than 1000   , freemarker  generate MetricsMetaInfo method will cause error such as MetricsMetaInfo("xxxx_cpm", 10,001, entityId)
Co-authored-by: Njingjiu <jingjiu@tsign.cn>
Co-authored-by: wu-sheng's avatar吴晟 Wu Sheng <wu.sheng@foxmail.com>
上级 8bf38cc2
......@@ -130,7 +130,7 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> {
* Hard coded the max size. This is only the batch size of one metrics, too large number is meaningless.
*/
int maxBatchGetSize = 2000;
final int batchSize = Math.max(maxBatchGetSize, lastCollection.size());
final int batchSize = Math.min(maxBatchGetSize, lastCollection.size());
List<Metrics> metricsList = new ArrayList<>();
for (Metrics data : lastCollection) {
transWorker.ifPresent(metricsTransWorker -> metricsTransWorker.in(data));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册