mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
Alerting: Nilcheck JitterStrategyFrom so it can be used in contexts without feature toggles (#80841)
Nilcheck so tests can have a nil feature toggles
This commit is contained in:
parent
f285eb6717
commit
18b9c8fd5f
@ -21,6 +21,9 @@ const (
|
||||
// JitterStrategyFrom returns the JitterStrategy indicated by the current Grafana feature toggles.
|
||||
func JitterStrategyFrom(toggles featuremgmt.FeatureToggles) JitterStrategy {
|
||||
strategy := JitterNever
|
||||
if toggles == nil {
|
||||
return strategy
|
||||
}
|
||||
if toggles.IsEnabledGlobally(featuremgmt.FlagJitterAlertRules) {
|
||||
strategy = JitterByGroup
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user