Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
6b6aada0
Commit
6b6aada0
authored
Sep 02, 2019
by
高鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ruansiyuan' into 'master'
群发做1s延时,改为异步 See merge request rays/pcloud-book!118
parents
29091089
3da09d71
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
PushBizImpl.java
.../main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
+11
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
View file @
6b6aada0
...
...
@@ -265,8 +265,8 @@ public class PushBizImpl implements PushBiz {
pushRecord
.
setPushStatus
(
PushStatusEnum
.
PUSHING
.
value
);
//新增群发记录
pushRecordDao
.
insert
(
pushRecord
);
//新增细化到群的记录并发送消息
addPushGroupRecordsAndSend
(
pushGroupList
,
pushRecord
,
pushItemList
);
//新增细化到群的记录并发送消息
,异步
ThreadPoolUtils
.
SEND_MESSAGE_THREAD_POOL
.
execute
(()
->
addPushGroupRecordsAndSend
(
pushGroupList
,
pushRecord
,
pushItemList
)
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
.
getMessage
(),
"群发消息失败!"
+
e
);
pushRecordDao
.
updateStateById
(
pushRecord
.
getId
(),
PushStatusEnum
.
FAIL
.
value
);
...
...
@@ -299,7 +299,15 @@ public class PushBizImpl implements PushBiz {
String
altId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
groupQrcode
.
getWeixinGroupId
());
//遍历发送消息
for
(
PushItem
pushItem
:
pushItemList
)
{
sendWechatMessage
(
pushGroup
,
pushItem
,
pushGroupRecord
.
getId
(),
altId
);
try
{
LOGGER
.
info
(
"发送一个群里的一个消息开始pushGroup="
+
pushGroup
.
toString
()
+
"pushItem="
+
pushItem
.
toString
()
+
"altId="
+
altId
);
sendWechatMessage
(
pushGroup
,
pushItem
,
pushGroupRecord
.
getId
(),
altId
);
LOGGER
.
info
(
"发送一个群里的一个消息结束,休眠1秒pushGroup="
+
pushGroup
.
toString
()
+
"pushItem="
+
pushItem
.
toString
()
+
"altId="
+
altId
);
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
LOGGER
.
error
(
"发消息休眠1秒出错"
,
e
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment