fix: change logic for the system proxy setting (#8839)

This commit is contained in:
CityFun 2025-05-26 19:12:18 +08:00 committed by GitHub
parent ee04f4afc8
commit 610be1755a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -212,7 +212,11 @@ func (u *SettingService) UpdateProxy(req dto.ProxyUpdate) error {
return err
}
go func() {
if err := xpack.Sync(constant.SyncSystemProxy); err != nil {
syncScope := constant.SyncSystemProxy
if req.WithDockerRestart {
syncScope = constant.SyncSystemProxyWithRestartDocker
}
if err := xpack.Sync(syncScope); err != nil {
global.LOG.Errorf("sync proxy to node failed, err: %v", err)
}
}()

View file

@ -43,12 +43,13 @@ const (
)
const (
SyncSystemProxy = "SyncSystemProxy"
SyncScripts = "SyncScripts"
SyncBackupAccounts = "SyncBackupAccounts"
SyncAlertSetting = "SyncAlertSetting"
SyncCustomApp = "SyncCustomApp"
SyncLanguage = "SyncLanguage"
SyncSystemProxy = "SyncSystemProxy"
SyncScripts = "SyncScripts"
SyncBackupAccounts = "SyncBackupAccounts"
SyncAlertSetting = "SyncAlertSetting"
SyncCustomApp = "SyncCustomApp"
SyncLanguage = "SyncLanguage"
SyncSystemProxyWithRestartDocker = "SyncSystemProxyWithRestartDocker"
)
var WebUrlMap = map[string]struct{}{