mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
rules: Remove redundant RLock to avoid double RLock (#7183)
Signed-off-by: BurtonQin <bobbqqin@gmail.com>
This commit is contained in:
parent
808a14569d
commit
8219b442c8
|
@ -1109,9 +1109,6 @@ func (m *Manager) Rules() []Rule {
|
||||||
|
|
||||||
// AlertingRules returns the list of the manager's alerting rules.
|
// AlertingRules returns the list of the manager's alerting rules.
|
||||||
func (m *Manager) AlertingRules() []*AlertingRule {
|
func (m *Manager) AlertingRules() []*AlertingRule {
|
||||||
m.mtx.RLock()
|
|
||||||
defer m.mtx.RUnlock()
|
|
||||||
|
|
||||||
alerts := []*AlertingRule{}
|
alerts := []*AlertingRule{}
|
||||||
for _, rule := range m.Rules() {
|
for _, rule := range m.Rules() {
|
||||||
if alertingRule, ok := rule.(*AlertingRule); ok {
|
if alertingRule, ok := rule.(*AlertingRule); ok {
|
||||||
|
|
Loading…
Reference in a new issue