mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Add ClientPause command.
This commit is contained in:
@ -18,8 +18,10 @@ var _ = Describe("Commands", func() {
|
||||
|
||||
BeforeEach(func() {
|
||||
client = redis.NewClient(&redis.Options{
|
||||
Addr: redisAddr,
|
||||
PoolTimeout: 30 * time.Second,
|
||||
Addr: redisAddr,
|
||||
ReadTimeout: 100 * time.Millisecond,
|
||||
WriteTimeout: 100 * time.Millisecond,
|
||||
PoolTimeout: 30 * time.Second,
|
||||
})
|
||||
})
|
||||
|
||||
@ -75,6 +77,19 @@ var _ = Describe("Commands", func() {
|
||||
Expect(r.Val()).To(Equal(""))
|
||||
})
|
||||
|
||||
It("should ClientPause", func() {
|
||||
err := client.ClientPause(time.Second).Err()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
Consistently(func() error {
|
||||
return client.Ping().Err()
|
||||
}, "500ms").Should(HaveOccurred())
|
||||
|
||||
Eventually(func() error {
|
||||
return client.Ping().Err()
|
||||
}, "1s").ShouldNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("should ConfigGet", func() {
|
||||
r := client.ConfigGet("*")
|
||||
Expect(r.Err()).NotTo(HaveOccurred())
|
||||
|
Reference in New Issue
Block a user