Authored by 张帅

fix

package com.yohobuy.platform.grass.service.impl;
import com.google.common.collect.Lists;
import com.yoho.core.config.ConfigReader;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.service.model.sns.model.enums.GrassInboxBusinessTypeEnum;
... ... @@ -95,13 +96,14 @@ public class GrassUserVirtualImpl implements IGrassVirtualService{
for (GrassInBoxAddReq message : messageList) {
l.add(message);
if (l.size() % batchSize == 0) {
sendMessage(l);
l.clear();
List<GrassInBoxAddReq> reqlist = Lists.newArrayList(l);
sendMessage(reqlist);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
l.clear();
}
}
if (CollectionUtils.isNotEmpty(l)) {
... ...