@@ -221,7 +221,7 @@ const (
221221 dSettingsKeySecurityRepoType = "security-repo-type"
222222 dSettingsKeyPlatformRepoComponents = "platform-repo-components"
223223 DSettingsKeyIncrementalUpdate = "incremental-update"
224- dSettingsKeyIntranetUpdate = "intranet-update"
224+ DSettingsKeyIntranetUpdate = "intranet-update"
225225 dSettingsKeyGetHardwareIdByHelper = "hardware-id-from-helper"
226226 dSettingsKeyDeliveryRemoteDownloadGlobalLimit = "delivery-remote-download-global-limit"
227227 dSettingsKeyDeliveryRemoteUploadGlobalLimit = "delivery-remote-upload-global-limit"
@@ -309,7 +309,7 @@ func getConfigFromDSettings() *Config {
309309 c .IncrementalUpdate = v .Value ().(bool )
310310 }
311311
312- v , err = c .dsLastoreManager .Value (0 , dSettingsKeyIntranetUpdate )
312+ v , err = c .dsLastoreManager .Value (0 , DSettingsKeyIntranetUpdate )
313313 if err != nil {
314314 logger .Warning (err )
315315 } else {
@@ -793,12 +793,20 @@ func getConfigFromDSettings() *Config {
793793 _ , err = c .dsLastoreManager .ConnectValueChanged (func (key string ) {
794794 logger .Infof ("config update: key=%s" , key )
795795 switch key {
796- case dSettingsKeyIntranetUpdate :
797- v , err = c .dsLastoreManager .Value (0 , dSettingsKeyIntranetUpdate )
796+ case DSettingsKeyIntranetUpdate :
797+ v , err = c .dsLastoreManager .Value (0 , DSettingsKeyIntranetUpdate )
798798 if err != nil {
799799 logger .Warning (err )
800800 } else {
801- c .IntranetUpdate = v .Value ().(bool )
801+ oldValue := c .PlatformUpdate
802+ newValue := v .Value ().(bool )
803+ c .IntranetUpdate = newValue
804+ c .dsettingsChangedCbMapMu .Lock ()
805+ cb := c .dsettingsChangedCbMap [key ]
806+ if cb != nil {
807+ go cb (oldValue , newValue )
808+ }
809+ c .dsettingsChangedCbMapMu .Unlock ()
802810 }
803811 case DSettingsKeyPlatformUpdate :
804812 v , err = c .dsLastoreManager .Value (0 , DSettingsKeyPlatformUpdate )
@@ -1073,6 +1081,11 @@ func (c *Config) SetAllowInstallRemovePkgExecPaths(paths []string) error {
10731081// return c.save(dSettingsKeyNeedDownloadSize, size)
10741082// }
10751083
1084+ func (c * Config ) SetLastCheckTime (lastCheckTime time.Time ) error {
1085+ c .LastCheckTime = lastCheckTime
1086+ return c .save (dSettingsKeyLastCheckTime , c .LastCheckTime .Format (configTimeLayout ))
1087+ }
1088+
10761089func (c * Config ) SetDownloadSpeedLimitConfig (config string ) error {
10771090 c .DownloadSpeedLimitConfig = config
10781091 return c .save (dSettingsKeyDownloadSpeedLimit , config )
0 commit comments