mirror of
https://github.com/hibiken/asynq.git
synced 2025-02-22 20:00:19 +08:00
Add redis conn close func to client
This commit is contained in:
parent
9884d5f2fa
commit
44aad7f037
@ -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...)
|
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 {
|
func (c *Client) enqueueAt(t time.Time, task *Task, opts ...Option) error {
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
defer c.mu.Unlock()
|
defer c.mu.Unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user