mirror of https://github.com/tidwall/tile38.git
Increase the precision of TIMEOUT
This commit ensures that the TIMEOUT is always checked prior to returning data to the client, and that the elapsed command time cannot be greater than the timeout value.
This commit is contained in:
parent
a2b874ab9d
commit
06a92d8a21
|
@ -965,7 +965,11 @@ func (server *Server) handleInputCommand(client *Client, msg *Message) error {
|
|||
}
|
||||
}()
|
||||
}
|
||||
return server.command(msg, client)
|
||||
res, d, err = server.command(msg, client)
|
||||
if msg.Deadline != nil {
|
||||
msg.Deadline.Check()
|
||||
}
|
||||
return res, d, err
|
||||
}()
|
||||
if res.Type() == resp.Error {
|
||||
return writeErr(res.String())
|
||||
|
|
Loading…
Reference in New Issue