Skip to content

Commit 5ea92e6

Browse files
fix: change logic for the system proxy setting
1 parent ee04f4a commit 5ea92e6

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

core/app/service/setting.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ func (u *SettingService) UpdateProxy(req dto.ProxyUpdate) error {
212212
return err
213213
}
214214
go func() {
215-
if err := xpack.Sync(constant.SyncSystemProxy); err != nil {
215+
syncScope := constant.SyncSystemProxy
216+
if req.WithDockerRestart {
217+
syncScope = constant.SyncSystemProxyWithRestartDocker
218+
}
219+
if err := xpack.Sync(syncScope); err != nil {
216220
global.LOG.Errorf("sync proxy to node failed, err: %v", err)
217221
}
218222
}()

core/constant/common.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ const (
4343
)
4444

4545
const (
46-
SyncSystemProxy = "SyncSystemProxy"
47-
SyncScripts = "SyncScripts"
48-
SyncBackupAccounts = "SyncBackupAccounts"
49-
SyncAlertSetting = "SyncAlertSetting"
50-
SyncCustomApp = "SyncCustomApp"
51-
SyncLanguage = "SyncLanguage"
46+
SyncSystemProxy = "SyncSystemProxy"
47+
SyncScripts = "SyncScripts"
48+
SyncBackupAccounts = "SyncBackupAccounts"
49+
SyncAlertSetting = "SyncAlertSetting"
50+
SyncCustomApp = "SyncCustomApp"
51+
SyncLanguage = "SyncLanguage"
52+
SyncSystemProxyWithRestartDocker = "SyncSystemProxyWithRestartDocker"
5253
)
5354

5455
var WebUrlMap = map[string]struct{}{

0 commit comments

Comments
 (0)