diff --git a/commands.go b/commands.go index 513f52ba..b6df30cf 100644 --- a/commands.go +++ b/commands.go @@ -470,12 +470,6 @@ func (c *commandable) MSetNX(pairs ...string) *BoolCmd { return cmd } -func (c *commandable) PSetEx(key string, expiration time.Duration, value string) *StatusCmd { - cmd := NewStatusCmd("PSETEX", key, formatMs(expiration), value) - c.Process(cmd) - return cmd -} - func (c *commandable) Set(key, value string, expiration time.Duration) *StatusCmd { args := []string{"SET", key, value} if expiration > 0 { @@ -501,12 +495,6 @@ func (c *commandable) SetBit(key string, offset int64, value int) *IntCmd { return cmd } -func (c *commandable) SetEx(key string, expiration time.Duration, value string) *StatusCmd { - cmd := NewStatusCmd("SETEX", key, formatSec(expiration), value) - c.Process(cmd) - return cmd -} - func (c *commandable) SetNX(key, value string, expiration time.Duration) *BoolCmd { var cmd *BoolCmd if expiration == 0 { diff --git a/commands_test.go b/commands_test.go index a34e9d17..c0ab161f 100644 --- a/commands_test.go +++ b/commands_test.go @@ -873,22 +873,6 @@ var _ = Describe("Commands", func() { Expect(mSetNX.Val()).To(Equal(false)) }) - It("should PSetEx", func() { - expiration := 50 * time.Millisecond - psetex := client.PSetEx("key", expiration, "hello") - Expect(psetex.Err()).NotTo(HaveOccurred()) - Expect(psetex.Val()).To(Equal("OK")) - - pttl := client.PTTL("key") - Expect(pttl.Err()).NotTo(HaveOccurred()) - Expect(pttl.Val() <= expiration).To(Equal(true)) - Expect(pttl.Val() >= expiration-time.Millisecond).To(Equal(true)) - - get := client.Get("key") - Expect(get.Err()).NotTo(HaveOccurred()) - Expect(get.Val()).To(Equal("hello")) - }) - It("should Set with expiration", func() { err := client.Set("key", "hello", 100*time.Millisecond).Err() Expect(err).NotTo(HaveOccurred()) @@ -912,16 +896,6 @@ var _ = Describe("Commands", func() { Expect(get.Val()).To(Equal("hello")) }) - It("should SetEx", func() { - setEx := client.SetEx("key", 10*time.Second, "hello") - Expect(setEx.Err()).NotTo(HaveOccurred()) - Expect(setEx.Val()).To(Equal("OK")) - - ttl := client.TTL("key") - Expect(ttl.Err()).NotTo(HaveOccurred()) - Expect(ttl.Val()).To(Equal(10 * time.Second)) - }) - It("should SetNX", func() { setNX := client.SetNX("key", "hello", 0) Expect(setNX.Err()).NotTo(HaveOccurred())