Skip to content

Commit

Permalink
fix race
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanyaru committed Aug 23, 2019
1 parent 9beb055 commit 67d5330
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ type metricKV struct {
}

func (r *StandardRegistry) registered() []metricKV {
metrics := make([]metricKV, 0, len(r.metrics))
r.mutex.RLock()
defer r.mutex.RUnlock()
metrics := make([]metricKV, 0, len(r.metrics))
for name, i := range r.metrics {
metrics = append(metrics, metricKV{
name: name,
Expand Down

0 comments on commit 67d5330

Please sign in to comment.