Commit 4be82047 by zhangxingmin

push

parent 237b5e3f
...@@ -95,6 +95,10 @@ public class EmailSendJobHandler { ...@@ -95,6 +95,10 @@ public class EmailSendJobHandler {
// 遍历所有收件人,逐个发送邮件 // 遍历所有收件人,逐个发送邮件
for (EmailTaskRecipients recipient : recipients) { for (EmailTaskRecipients recipient : recipients) {
try { try {
// 添加发送间隔,避免频率过高
if (successCount > 0) {
Thread.sleep(2000); // 2秒间隔
}
// 处理抄送人列表:将数据库中的逗号分隔字符串转换为List // 处理抄送人列表:将数据库中的逗号分隔字符串转换为List
List<String> ccEmailList = StringUtils.isNotBlank(recipient.getCcEmail()) ? List<String> ccEmailList = StringUtils.isNotBlank(recipient.getCcEmail()) ?
Arrays.asList(recipient.getCcEmail().split(";")) : Arrays.asList(recipient.getCcEmail().split(";")) :
......
...@@ -123,6 +123,11 @@ public class ApiEmailSendServiceImpl implements ApiEmailSendService { ...@@ -123,6 +123,11 @@ public class ApiEmailSendServiceImpl implements ApiEmailSendService {
// 遍历所有收件人,逐个发送邮件 // 遍历所有收件人,逐个发送邮件
for (EmailTaskRecipients recipient : recipients) { for (EmailTaskRecipients recipient : recipients) {
try { try {
// 添加发送间隔,避免频率过高
if (successCount > 0) {
Thread.sleep(2000); // 2秒间隔
}
// 处理抄送人列表:将数据库中的逗号分隔字符串转换为List // 处理抄送人列表:将数据库中的逗号分隔字符串转换为List
List<String> ccEmailList = StringUtils.isNotBlank(recipient.getCcEmail()) ? List<String> ccEmailList = StringUtils.isNotBlank(recipient.getCcEmail()) ?
Arrays.asList(recipient.getCcEmail().split(";")) : Arrays.asList(recipient.getCcEmail().split(";")) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment