back_recharge
parent
bf1a911880
commit
dfdd659e0c
|
@ -60,8 +60,7 @@ public class MinuteTask extends Thread {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
LOGGER.info("MinuteTask start...");
|
LOGGER.info("MinuteTask start... online use num::{} memory count={}", OnlineUserManager.sessionMap.entrySet().size(), UserManager.getCount());
|
||||||
LOGGER.info("online use num::"+ OnlineUserManager.sessionMap.entrySet().size());
|
|
||||||
//TODO 每分钟逻辑通过监听事件处理 已经迁移活动和热更新
|
//TODO 每分钟逻辑通过监听事件处理 已经迁移活动和热更新
|
||||||
Poster.getPoster().dispatchEvent(new MinuteTaskEvent());
|
Poster.getPoster().dispatchEvent(new MinuteTaskEvent());
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
package com.ljsd.jieling.thread.task;
|
|
||||||
|
|
||||||
import com.ljsd.GameApplication;
|
|
||||||
import com.ljsd.jieling.config.reportData.DataMessageUtils;
|
|
||||||
import com.ljsd.jieling.ktbeans.OnlineProp;
|
|
||||||
import com.ljsd.jieling.ktbeans.OnlineUserCalEvent;
|
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import util.TimeUtils;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lvxinran
|
|
||||||
* @date 2020/7/20
|
|
||||||
* @discribe
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class OnlineUserTapTask extends Thread {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
while (true){
|
|
||||||
Thread.sleep(5*60000);//5分钟上报一次
|
|
||||||
int serverId = GameApplication.serverId;
|
|
||||||
Set<Integer> uids = OnlineUserManager.sessionMap.keySet();
|
|
||||||
OnlineUserCalEvent onlineUserCalEvent = new OnlineUserCalEvent();
|
|
||||||
|
|
||||||
onlineUserCalEvent.setAppid(GameApplication.serverProperties.getAppId()==null?"APPID":GameApplication.serverProperties.getAppId());
|
|
||||||
onlineUserCalEvent.setOnlines(new OnlineProp[]{new OnlineProp(String.valueOf(serverId),uids.size(), TimeUtils.now()/1000)});
|
|
||||||
DataMessageUtils.sendOnlinePost(onlineUserCalEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -28,9 +28,8 @@ public class HttpPool {
|
||||||
private static String charset = "UTF-8";
|
private static String charset = "UTF-8";
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
poolConnection.setMaxTotal(100);
|
poolConnection.setMaxTotal(5);
|
||||||
poolConnection.setDefaultMaxPerRoute(100);
|
poolConnection.setDefaultMaxPerRoute(5);
|
||||||
poolConnection.setDefaultMaxPerRoute(10);
|
|
||||||
httpclient = HttpClients.custom().setConnectionManager(poolConnection).build();
|
httpclient = HttpClients.custom().setConnectionManager(poolConnection).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue