diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-06-05 00:02:19 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-06-05 00:02:19 +0300 |
| commit | 70f250dfe1e24249a4cc8102e3fef65959dfb15a (patch) | |
| tree | 9fdc990d656267abf6facafd851ab7b4835be977 /web/job | |
| parent | 1030bcf321f15ada665ca3c55436d7c2449b5faf (diff) | |
[feature] using xray api and more
Improve DB performance
[api] backward compatibility: add client by update
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/job')
| -rw-r--r-- | web/job/check_inbound_job.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/web/job/check_inbound_job.go b/web/job/check_inbound_job.go index 2b24afb0..cb8bd331 100644 --- a/web/job/check_inbound_job.go +++ b/web/job/check_inbound_job.go @@ -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() } } |
