MCPcopy Create free account
hub / github.com/cortexproject/cortex / multiClientRuntimeConfigChannel

Function multiClientRuntimeConfigChannel

pkg/cortex/runtime_config.go:91–116  ·  view source on GitHub ↗
(manager *runtimeconfig.Manager)

Source from the content-addressed store, hash-verified

89}
90
91func multiClientRuntimeConfigChannel(manager *runtimeconfig.Manager) func() <-chan kv.MultiRuntimeConfig {
92 if manager == nil {
93 return nil
94 }
95 // returns function that can be used in MultiConfig.ConfigProvider
96 return func() <-chan kv.MultiRuntimeConfig {
97 outCh := make(chan kv.MultiRuntimeConfig, 1)
98
99 // push initial config to the channel
100 val := manager.GetConfig()
101 if cfg, ok := val.(*RuntimeConfigValues); ok && cfg != nil {
102 outCh <- cfg.Multi
103 }
104
105 ch := manager.CreateListenerChannel(1)
106 go func() {
107 for val := range ch {
108 if cfg, ok := val.(*RuntimeConfigValues); ok && cfg != nil {
109 outCh <- cfg.Multi
110 }
111 }
112 }()
113
114 return outCh
115 }
116}
117
118func ingesterInstanceLimits(manager *runtimeconfig.Manager) func() *ingester.InstanceLimits {
119 if manager == nil {

Callers 2

initRingMethod · 0.85
initIngesterServiceMethod · 0.85

Calls 2

CreateListenerChannelMethod · 0.80
GetConfigMethod · 0.65

Tested by

no test coverage detected