Commit 361636bf authored by masala's avatar masala

add defer

parent 95781a0a
Pipeline #929 failed with stage
in 7 minutes and 19 seconds
......@@ -52,11 +52,11 @@ func (s *Session) waitForSent(id MessageID) error {
waitCh, ok = s.waitSentChans[*id]
s.mapLock.Unlock()
if ok {
func() {
defer func() {
s.mapLock.Lock()
delete(s.waitSentChans, *id)
s.mapLock.Unlock()
}
}()
} else {
err = fmt.Errorf("[%v] Failure waiting for reply, invalid message ID", id)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment