From 3fa2fb8dc00b63abee8f1ba89e7f3119f8df5ffc Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Thu, 26 Jan 2017 15:59:44 +0200 Subject: [PATCH] ObjectIdleTime accepts one key. --- commands.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/commands.go b/commands.go index 2e50cda..ce5f92d 100644 --- a/commands.go +++ b/commands.go @@ -57,7 +57,7 @@ type Cmdable interface { Move(key string, db int64) *BoolCmd ObjectRefCount(keys ...string) *IntCmd ObjectEncoding(keys ...string) *StringCmd - ObjectIdleTime(keys ...string) *DurationCmd + ObjectIdleTime(key string) *DurationCmd Persist(key string) *BoolCmd PExpire(key string, expiration time.Duration) *BoolCmd PExpireAt(key string, tm time.Time) *BoolCmd @@ -378,14 +378,8 @@ func (c *cmdable) ObjectEncoding(keys ...string) *StringCmd { return cmd } -func (c *cmdable) ObjectIdleTime(keys ...string) *DurationCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "object" - args[1] = "idletime" - for i, key := range keys { - args[2+i] = key - } - cmd := NewDurationCmd(time.Second, args...) +func (c *cmdable) ObjectIdleTime(key string) *DurationCmd { + cmd := NewDurationCmd(time.Second, "object", "idletime", key) c.process(cmd) return cmd }