优化 mp 账号的刷新机制,使用 Job 轮询,替换 MQ 广播

This commit is contained in:
YunaiV
2023-07-27 20:25:15 +08:00
parent 5d6308e4bb
commit c33186569d
14 changed files with 62 additions and 115 deletions

View File

@ -15,7 +15,6 @@ import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateR
import cn.iocoder.yudao.module.pay.convert.channel.PayChannelConvert;
import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO;
import cn.iocoder.yudao.module.pay.dal.mysql.channel.PayChannelMapper;
import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@ -112,7 +111,7 @@ public class PayChannelServiceImpl implements PayChannelService {
channelMapper.insert(channel);
// 刷新缓存
refreshLocalCache();
initLocalCache();
return channel.getId();
}
@ -127,7 +126,7 @@ public class PayChannelServiceImpl implements PayChannelService {
channelMapper.updateById(channel);
// 刷新缓存
refreshLocalCache();
initLocalCache();
}
/**
@ -160,7 +159,7 @@ public class PayChannelServiceImpl implements PayChannelService {
channelMapper.deleteById(id);
// 刷新缓存
refreshLocalCache();
initLocalCache();
}
private PayChannelDO validateChannelExists(Long id) {