mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-15 09:35:00 +03:00
fix(node): reconcile the local core after node disables without forcing it
The node traffic sync restarted the master's own Xray with force after any tick that disabled clients, so a node reporting a fresh over-quota client every few seconds dropped every local user's connections each time, though nodes serve none of them. Use the non-forced restart the local traffic job uses: an unchanged local config keeps the core, and a change still restarts when restartXrayOnClientDisable asks for it. Reaching RestartXray needs a running core, so no unit test covers this.
This commit is contained in:
@@ -140,7 +140,9 @@ func (j *NodeTrafficSyncJob) Run() {
|
|||||||
}
|
}
|
||||||
if clientsDisabled {
|
if clientsDisabled {
|
||||||
if restartOnDisable, settingErr := j.settingService.GetRestartXrayOnClientDisable(); settingErr == nil && restartOnDisable {
|
if restartOnDisable, settingErr := j.settingService.GetRestartXrayOnClientDisable(); settingErr == nil && restartOnDisable {
|
||||||
if err := j.xrayService.RestartXray(true); err != nil {
|
// Not forced: a client only nodes serve leaves the local config unchanged, and a node
|
||||||
|
// deciding when this tick disables clients must not decide when local users drop.
|
||||||
|
if err := j.xrayService.RestartXray(false); err != nil {
|
||||||
logger.Warning("node traffic sync: restart xray after disabling clients failed:", err)
|
logger.Warning("node traffic sync: restart xray after disabling clients failed:", err)
|
||||||
j.xrayService.SetToNeedRestart()
|
j.xrayService.SetToNeedRestart()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user