Skip to content

Commit

Permalink
add an advanced option that will override the v2 in the config url wi…
Browse files Browse the repository at this point in the history
…th v1
  • Loading branch information
elliotCamblor committed Aug 22, 2024
1 parent 1e99be1 commit ded1167
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions configmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,17 @@ func (e *EnvironmentConfigManager) setConfig(config []byte, eTag, rayId, lastMod
}

func (e *EnvironmentConfigManager) getConfigURL() string {
configBasePath := e.cfg.ConfigCDNBasePath
configBasePath := e.cfg.ConfigCDNBasePath

return fmt.Sprintf("%s/config/v2/server/%s.json", configBasePath, e.sdkKey)
version := "v2"
if e.options.AdvancedOptions.OverrideConfigWithV1 {
version = "v1"
}

return fmt.Sprintf("%s/config/%s/server/%s.json", configBasePath, version, e.sdkKey)
}


func (e *EnvironmentConfigManager) HasConfig() bool {
return e.localBucketing.HasConfig()
}
Expand Down
1 change: 1 addition & 0 deletions configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type EventQueueOptions = api.EventQueueOptions

type AdvancedOptions struct {
OverridePlatformData *api.PlatformData
OverrideConfigWithV1 bool
}

type Options struct {
Expand Down

0 comments on commit ded1167

Please sign in to comment.