Skip to content

Commit

Permalink
Update the cache before updating the rule manager
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
  • Loading branch information
damnever committed Nov 29, 2024
1 parent dfe7331 commit e4d2823
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ruler/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (r *DefaultMultiTenantManager) syncRulesToManager(ctx context.Context, user
if !existing || rulesUpdated || externalLabelsUpdated {
level.Debug(r.logger).Log("msg", "updating rules", "user", user)
r.configUpdatesTotal.WithLabelValues(user).Inc()
if rulesUpdated && existing {
if (rulesUpdated || externalLabelsUpdated) && existing {
r.updateRuleCache(user, manager.RuleGroups())
}
err = manager.Update(r.cfg.EvaluationInterval, files, externalLabels, r.cfg.ExternalURL.String(), ruleGroupIterationFunc)
Expand Down

0 comments on commit e4d2823

Please sign in to comment.