[feature] using xray api and more

Improve DB performance
[api] backward compatibility: add client by update

Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
MHSanaei
2023-06-05 00:32:19 +03:30
parent 1030bcf321
commit 70f250dfe1
8 changed files with 533 additions and 178 deletions
+8 -6
View File
@@ -15,19 +15,21 @@ func NewCheckInboundJob() *CheckInboundJob {
}
func (j *CheckInboundJob) Run() {
count, err := j.inboundService.DisableInvalidClients()
needRestart, count, err := j.inboundService.DisableInvalidClients()
if err != nil {
logger.Warning("disable invalid Client err:", err)
logger.Warning("Error in disabling invalid clients:", err)
} else if count > 0 {
logger.Debugf("disabled %v Client", count)
j.xrayService.SetToNeedRestart()
logger.Debugf("%v clients disabled", count)
if needRestart {
j.xrayService.SetToNeedRestart()
}
}
count, err = j.inboundService.DisableInvalidInbounds()
if err != nil {
logger.Warning("disable invalid inbounds err:", err)
logger.Warning("Error in disabling invalid inbounds:", err)
} else if count > 0 {
logger.Debugf("disabled %v inbounds", count)
logger.Debugf("%v inbounds disabled", count)
j.xrayService.SetToNeedRestart()
}
}