#502 Check if key blank before instantiate new list.

This commit is contained in:
nkorange 2019-04-02 19:46:24 +08:00
parent 51dd3db7c3
commit d8b768b8a7

View File

@ -107,14 +107,16 @@ public class TaskDispatcher {
continue;
}
if (StringUtils.isBlank(key)) {
continue;
}
if (dataSize == 0) {
keys = new ArrayList<>();
}
if (StringUtils.isNotBlank(key)) {
keys.add(key);
dataSize++;
}
keys.add(key);
dataSize++;
if (dataSize == partitionConfig.getBatchSyncKeyCount() ||
(System.currentTimeMillis() - lastDispatchTime) > partitionConfig.getTaskDispatchPeriod()) {