From 44aad7f0379af3276206e0a1b350595e4ab8be55 Mon Sep 17 00:00:00 2001 From: t-asaka Date: Fri, 8 May 2020 18:25:50 +0900 Subject: [PATCH] Add redis conn close func to client --- client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.go b/client.go index 3da3a89..4d57cdf 100644 --- a/client.go +++ b/client.go @@ -209,6 +209,11 @@ func (c *Client) EnqueueIn(d time.Duration, task *Task, opts ...Option) error { return c.enqueueAt(time.Now().Add(d), task, opts...) } +// Close closes the connection with redis server. +func (c *Client) Close() error { + return c.rdb.Close() +} + func (c *Client) enqueueAt(t time.Time, task *Task, opts ...Option) error { c.mu.Lock() defer c.mu.Unlock()