1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Fix rate limiter and add test.

This commit is contained in:
Vladimir Mihailenco
2014-11-13 14:26:14 +02:00
parent 9805fc35f8
commit b68ae5e548
5 changed files with 61 additions and 10 deletions

View File

@ -1,6 +1,7 @@
package redis
import (
"io"
"strconv"
"time"
)
@ -1120,7 +1121,16 @@ func (c *Client) shutdown(modifier string) *StatusCmd {
}
cmd := NewStatusCmd(args...)
c.Process(cmd)
c.Close()
if err := cmd.Err(); err != nil {
if err == io.EOF {
// Server quit as expected.
cmd.err = nil
}
} else {
// Server did not quit. String reply contains the reason.
cmd.err = errorf(cmd.val)
cmd.val = ""
}
return cmd
}