mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-26 18:21:05 +08:00
tiny fix
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
type Connection struct {
|
||||
conn net.Conn
|
||||
|
||||
// waiting util reply finished
|
||||
// waiting until reply finished
|
||||
waitingReply wait.Wait
|
||||
|
||||
// lock while server sending response
|
||||
@@ -50,7 +50,11 @@ func (c *Connection) Write(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
c.waitingReply.Add(1)
|
||||
defer func() {
|
||||
c.waitingReply.Done()
|
||||
c.mu.Unlock()
|
||||
}()
|
||||
|
||||
_, err := c.conn.Write(b)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user