mirror of https://github.com/statping/statping
use Lock instead of RLock since delete() is a writing operation.
parent
3db4f1b373
commit
d95abf0728
|
@ -58,8 +58,8 @@ func (s Storage) Get(key string) []byte {
|
|||
}
|
||||
|
||||
func (s Storage) Delete(key string) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
delete(s.items, key)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue