fix(fix4): enforce runtime contract and orchestrator guardrails
This commit is contained in:
+14
-16
@@ -17,27 +17,25 @@ var kickMutex sync.Mutex
|
||||
|
||||
func CronHandleAccount() {
|
||||
go func() {
|
||||
hysteriaEnable, err := dao.GetConfig("key = ?", constant.Hysteria2Enable)
|
||||
if !Hysteria2IsRunning() {
|
||||
return
|
||||
}
|
||||
|
||||
apiPort, err := GetHysteria2ApiPort()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if hysteriaEnable.Value != nil && *hysteriaEnable.Value == "1" {
|
||||
apiPort, err := GetHysteria2ApiPort()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
trafficSecretConfig, err := dao.GetConfig("key = ?", constant.Hysteria2TrafficStatsSecret)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Сохранение данных трафика
|
||||
go saveAccountTraffic(apiPort, *trafficSecretConfig.Value)
|
||||
|
||||
// Принудительное отключение
|
||||
go kickAccount(apiPort, *trafficSecretConfig.Value)
|
||||
trafficSecretConfig, err := dao.GetConfig("key = ?", constant.Hysteria2TrafficStatsSecret)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Сохранение данных трафика
|
||||
go saveAccountTraffic(apiPort, *trafficSecretConfig.Value)
|
||||
|
||||
// Принудительное отключение
|
||||
go kickAccount(apiPort, *trafficSecretConfig.Value)
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user