加入相应注释
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(){
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();
/**
* ECS
*/
void scheduleECS();
/**
*
*/
void refresh();
/**
* ECS
*/
void dynamicEcs() throws Exception;
}

View File

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