加入相应注释
master
JangCan 2024-04-20 11:00:53 +08:00
parent 5f5972e6b3
commit a4c44b9a17
3 changed files with 28 additions and 1 deletions

View File

@ -40,4 +40,17 @@ public class GatewayController {
public void scheduleECS(){ public void scheduleECS(){
gatewayLoadService.scheduleECS(); gatewayLoadService.scheduleECS();
} }
/**
*
*/
@Scheduled(cron = "0/30 * * * * ?")
public void refresh(){
gatewayLoadService.refresh();
}
@Scheduled(cron = "0/30 * * * * ?")
public void dynamicEcs()throws Exception{
gatewayLoadService.dynamicEcs();
}
} }

View File

@ -12,8 +12,18 @@ public interface GatewayLoadService {
*/ */
String loadNode(); String loadNode();
/**
* ECS
*/
void scheduleECS(); void scheduleECS();
/**
*
*/
void refresh(); void refresh();
/**
* ECS
*/
void dynamicEcs() throws Exception;
} }

View File

@ -76,6 +76,9 @@ public class GatewayLoadServiceImpl implements GatewayLoadService {
} }
/**
* ECS
*/
@Override @Override
public void scheduleECS() { public void scheduleECS() {
//客户端初始化 //客户端初始化
@ -190,6 +193,7 @@ public class GatewayLoadServiceImpl implements GatewayLoadService {
/** /**
* ECS * ECS
*/ */
@Override
public void dynamicEcs() throws Exception { public void dynamicEcs() throws Exception {
//上线最大数量 //上线最大数量
Long vehicleMaxOnlineNum = gatewayNodeScoreCache.getNodeMaxOnlineNum(); Long vehicleMaxOnlineNum = gatewayNodeScoreCache.getNodeMaxOnlineNum();