Switch mutex RLock to Lock for RW method

This commit is contained in:
nxshock 2019-08-07 19:33:10 +05:00
parent 20fea5c1dd
commit a2869ebf85

View File

@ -191,8 +191,8 @@ func (backend *Backend) GetEventByID(id string) rooms.Event {
}
func (backend *Backend) PutEvent(event rooms.Event) error {
backend.mutex.RLock()
defer backend.mutex.RUnlock()
backend.mutex.Lock()
defer backend.mutex.Unlock()
backend.events[event.EventID] = event