提交 298ed9c1 编写于 作者: tangyaolong's avatar tangyaolong

代码加锁

上级 28a1a95f
...@@ -671,7 +671,7 @@ public class NotifyCoreService { ...@@ -671,7 +671,7 @@ public class NotifyCoreService {
* @return * @return
*/ */
@Scheduled(fixedRate = 300000) @Scheduled(fixedRate = 300000)
public void getBacklogPageContent() { public synchronized void getBacklogPageContent() {
MsgBodySearchContext context = new MsgBodySearchContext(); MsgBodySearchContext context = new MsgBodySearchContext();
context.setSize(Integer.MAX_VALUE); context.setSize(Integer.MAX_VALUE);
...@@ -691,6 +691,7 @@ public class NotifyCoreService { ...@@ -691,6 +691,7 @@ public class NotifyCoreService {
if (!msgMap.containsKey(toUserId)) { if (!msgMap.containsKey(toUserId)) {
return Page.empty(); return Page.empty();
} else { } else {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<MsgBody> pages = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(); com.baomidou.mybatisplus.extension.plugins.pagination.Page<MsgBody> pages = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>();
int current = context.getPages().getCurrent() < 0 ? 0 : (int) context.getPages().getCurrent(); int current = context.getPages().getCurrent() < 0 ? 0 : (int) context.getPages().getCurrent();
int size = context.getPages().getCurrent() < 0 ? 0 : (int) context.getPages().getSize(); int size = context.getPages().getCurrent() < 0 ? 0 : (int) context.getPages().getSize();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册