Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cmeeting
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
翟斌
cmeeting
Commits
2e9f0672
提交
2e9f0672
authored
8月 02, 2025
作者:
张开石
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/old' into old
父级
655b1603
672dbede
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
8 行删除
+11
-8
src/main/java/com/cmeeting/job/CmeetingJob.java
+5
-6
src/main/java/com/cmeeting/job/EmailPushTask.java
+6
-2
没有找到文件。
src/main/java/com/cmeeting/job/CmeetingJob.java
浏览文件 @
2e9f0672
...
...
@@ -227,7 +227,7 @@ public class CmeetingJob {
/**
* 定时扫描早于一小时之前的,所有邮件推送未重试过的会议,重新推送邮件
*/
@Scheduled
(
fixedRate
=
10
*
60
*
1000
,
initialDelay
=
1
5
*
60
*
1000
)
@Scheduled
(
fixedRate
=
10
*
60
*
1000
,
initialDelay
=
1
*
60
*
1000
)
public
void
emailPushRetry
()
{
if
(
isDev
)
{
return
;
...
...
@@ -237,7 +237,6 @@ public class CmeetingJob {
}
try
{
log
.
info
(
"-------邮件推送重试定时任务开始-------"
);
log
.
info
(
"当前时间: "
+
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ISO_LOCAL_DATE
));
//查出所有早于一小时前的,邮件推送失败且未重试过的会议
List
<
MeetingInfo
>
meetingInfoList
=
...
...
@@ -251,8 +250,7 @@ public class CmeetingJob {
if
(
meetingInfoList
==
null
||
meetingInfoList
.
isEmpty
())
{
log
.
info
(
"没有推送失败的邮件需要重试"
);
return
;
}
}
else
{
List
<
TencentMeetingVO
.
RecordFile
>
meetingFiles
=
new
ArrayList
<>();
for
(
MeetingInfo
meetingInfo
:
meetingInfoList
)
{
TencentMeetingVO
.
RecordFile
recordFile
=
TencentMeetingVO
.
RecordFile
.
builder
()
...
...
@@ -263,9 +261,10 @@ public class CmeetingJob {
//查出企微id和腾会id的关联关系
List
<
UserId
>
userIdRelations
=
userIdMapper
.
selectList
(
null
);
Map
<
String
,
String
>
tidWidRelations
=
userIdRelations
.
stream
().
collect
(
Collectors
.
toMap
(
UserId:
:
getTid
,
UserId:
:
getWid
));
Map
<
String
,
String
>
tidWidRelations
=
userIdRelations
.
stream
().
collect
(
Collectors
.
toMap
(
UserId:
:
getTid
,
UserId:
:
getWid
));
// 提交处理任务
producer
.
submitEmailPushTasks
(
meetingFiles
,
tidWidRelations
);
producer
.
submitEmailPushTasks
(
meetingFiles
,
tidWidRelations
);
}
log
.
info
(
"-------邮件推送重试定时任务结束--------"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
src/main/java/com/cmeeting/job/EmailPushTask.java
浏览文件 @
2e9f0672
...
...
@@ -65,6 +65,8 @@ public class EmailPushTask {
log
.
warn
(
"key already exists in redis!, key: {}"
,
key
);
return
;
}
log
.
info
(
"线程开始------------>"
);
long
l
=
System
.
currentTimeMillis
();
Boolean
isSuccess
=
false
;
AtomicInteger
retryCount
=
new
AtomicInteger
(
0
);
MeetingInfo
meetingInfo
=
meetingInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
MeetingInfo
>()
...
...
@@ -74,7 +76,7 @@ public class EmailPushTask {
log
.
warn
(
"邮件已推送, meetingId: {}"
,
meetingId
);
return
;
}
while
(
retryCount
.
intValue
()
<=
MAX_RETRY
&&
!
isSuccess
)
{
while
(
retryCount
.
intValue
()
<=
MAX_RETRY
&&
isSuccess
!=
null
&&
!
isSuccess
)
{
String
hostUid
=
meetingInfo
.
getHostUid
();
if
(!
tidWidRelations
.
containsKey
(
hostUid
)){
log
.
error
(
"邮件推送重试失败: 主持人对应关系未配置。meetingId {}"
,
meetingId
);
...
...
@@ -108,7 +110,6 @@ public class EmailPushTask {
try
(
InputStream
inputStream
=
minioUtils
.
getFile
(
meetingRecordTemplate
.
getTemplate
()))
{
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
inputStream
).
render
(
dataModel
);
template
.
writeAndClose
(
new
FileOutputStream
(
dataNetworkMinutesPath
));
byte
[]
recordXmlData
=
Files
.
readAllBytes
(
Paths
.
get
(
dataNetworkMinutesPath
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -141,6 +142,8 @@ public class EmailPushTask {
isSuccess
=
emailSender
.
sendEmailWithAttachment
(
emailPushBuilder
);
}
catch
(
Exception
e
)
{
// 异常处理
e
.
printStackTrace
();
log
.
error
(
"push email error: {}"
,
e
.
getMessage
());
int
currentRetryCount
=
retryCount
.
getAndIncrement
();
if
(
currentRetryCount
>
MAX_RETRY
)
{
log
.
error
(
"达到最大重试次数:meetingId {}"
,
meetingId
);
...
...
@@ -166,6 +169,7 @@ public class EmailPushTask {
);
}
redisUtils
.
del
(
key
);
log
.
info
(
"线程结束, 耗时: {} ms"
,
System
.
currentTimeMillis
()
-
l
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论