parent
bbe15e2019
commit
c930eb93bb
@ -15,8 +15,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.taobao.api.internal.util.NamedThreadFactory;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import com.xxl.job.core.util.ShardingUtil;
|
||||
import com.xxl.job.core.util.ShardingUtil.ShardingVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -61,7 +59,7 @@ public class GroupMessageSyncJob implements InitializingBean {
|
||||
}
|
||||
try {
|
||||
log.info("start sync group messages...");
|
||||
syncImpl(ShardingUtil.getShardingVo());
|
||||
syncImpl();
|
||||
log.info("sync group messages finished");
|
||||
} finally {
|
||||
isRunning = false;
|
||||
@ -69,7 +67,7 @@ public class GroupMessageSyncJob implements InitializingBean {
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
private void syncImpl(ShardingVO sharding) throws Exception {
|
||||
private void syncImpl() throws Exception {
|
||||
CountDownLatch completed = new CountDownLatch(1);
|
||||
MessageSyncController controller = new MessageSyncController(tps, completed::countDown);
|
||||
Date twoDayAgo = new DateTime(new Date()).minusDays(2).toDate();
|
||||
@ -82,8 +80,6 @@ public class GroupMessageSyncJob implements InitializingBean {
|
||||
.gt(Group::getDismissedAt, twoDayAgo))));
|
||||
for (List<Group> groups : cursor) {
|
||||
for (Group group : groups) {
|
||||
if (group.getTid() % sharding.getTotal() != sharding.getIndex())
|
||||
continue;
|
||||
controller.submitGroup(group);
|
||||
executor.execute(new GroupMessageSyncHandler(this, controller, group) {
|
||||
@Override
|
||||
|
||||
@ -19,7 +19,7 @@ public class GroupProps {
|
||||
|
||||
private int defaultMemberLimit = 499;
|
||||
|
||||
private int syncMessageTps = 10;
|
||||
private int syncMessageTps = 20;
|
||||
private int createGroupTps = 10;
|
||||
private int dismissGroupTps = 10;
|
||||
private int addMemberTps = 10;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user