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
81ed3e05ed
commit
d38aed4d2b
|
@ -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