Fix deadlock in monitor

pull/6763/head
Edd Robinson 2016-06-01 17:46:01 +01:00
parent 05ec9599b7
commit 774e398612
1 changed files with 1 additions and 1 deletions

View File

@ -166,11 +166,11 @@ type RemoteWriterConfig struct {
// SetPointsWriter can be used to set a writer for the monitoring points.
func (m *Monitor) SetPointsWriter(pw PointsWriter) error {
m.mu.Lock()
if !m.storeEnabled {
// not enabled, nothing to do
return nil
}
m.mu.Lock()
m.PointsWriter = pw
m.mu.Unlock()