FeatureFlags: define features outside settings.Cfg (take 3) (#44443)

This commit is contained in:
Ryan McKinley
2022-01-26 09:44:20 -08:00
committed by GitHub
parent 84a5910e56
commit 5d66194ec5
64 changed files with 1193 additions and 248 deletions
+3 -2
View File
@@ -10,6 +10,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/featuremgmt"
)
var random20HzStreamRegex = regexp.MustCompile(`random-20Hz-stream(-\d+)?`)
@@ -37,7 +38,7 @@ func (s *Service) SubscribeStream(_ context.Context, req *backend.SubscribeStrea
}
}
if s.cfg.FeatureToggles["live-pipeline"] {
if s.features.IsEnabled(featuremgmt.FlagLivePipeline) {
// While developing Live pipeline avoid sending initial data.
initialData = nil
}
@@ -126,7 +127,7 @@ func (s *Service) runTestStream(ctx context.Context, path string, conf testStrea
}
mode := data.IncludeDataOnly
if s.cfg.FeatureToggles["live-pipeline"] {
if s.features.IsEnabled(featuremgmt.FlagLivePipeline) {
mode = data.IncludeAll
}