REQ-3282: 处理异常

This commit is contained in:
yanglin 2024-12-23 11:10:27 +08:00
parent a735bc076d
commit 823b58045f

View File

@ -91,9 +91,9 @@ public class CardManager {
sendLogger.reloadAndLogCards("send:enqueue");
});
PushDeviceSnapshots deviceSnapshots = pushDeviceService.createDeviceSnapshots();
CardSendExecutor batchExecutor = new CardSendExecutor(request, executor);
CardSendExecutor groupExecutor = new CardSendExecutor(request, executor);
for (CardGroup group : sendModel.getCardGroups()) {
batchExecutor.submit(() -> {
groupExecutor.submit(() -> {
SendTemplateMessageParam imRequest = cardSupport.buildImSendRequest(
sendModel, group, deviceSnapshots);
CardLogger groupLogger = cardLoggers.createLogger(requestContext, group.getCards());
@ -113,7 +113,7 @@ public class CardManager {
});
}
try {
batchExecutor.awaitTermination(5, TimeUnit.MINUTES);
groupExecutor.awaitTermination(5, TimeUnit.MINUTES);
} catch (Exception e) {
log.warn("发送IM消息失败, deleteCardsWhenSendFail={}, request={}",
cardProps.isDeleteCardsWhenSendFail(), request, e);