feat(redis):add timeout method to extend blpop (#2472)

This commit is contained in:
#Suyghur
2022-10-01 20:53:54 +08:00
committed by GitHub
parent aa2be0163a
commit 0c66e041b5
2 changed files with 36 additions and 0 deletions

View File

@@ -1117,6 +1117,17 @@ func TestRedisBlpopEx(t *testing.T) {
})
}
func TestRedisBlpopWithTimeout(t *testing.T) {
runOnRedis(t, func(client *Redis) {
client.Ping()
var node mockedNode
_, err := client.BlpopWithTimeout(nil, 10*time.Second, "foo")
assert.NotNil(t, err)
_, err = client.BlpopWithTimeout(node, 10*time.Second, "foo")
assert.NotNil(t, err)
})
}
func TestRedisGeo(t *testing.T) {
runOnRedis(t, func(client *Redis) {
client.Ping()