From 4b81b91d3e8e3d5c9a8d513ef0e86c87214a1e4d Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Mon, 10 Aug 2020 06:13:06 -0700 Subject: [PATCH] Minor fix --- internal/rdb/rdb.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/internal/rdb/rdb.go b/internal/rdb/rdb.go index be52658..017fe9a 100644 --- a/internal/rdb/rdb.go +++ b/internal/rdb/rdb.go @@ -56,8 +56,7 @@ func (r *RDB) Enqueue(msg *base.TaskMessage) error { if err != nil { return err } - err := r.client.SAdd(base.AllQueues, msg.Queue).Err() - if err != nil { + if err := r.client.SAdd(base.AllQueues, msg.Queue).Err(); err != nil { return err } key := base.QueueKey(msg.Queue) @@ -85,8 +84,7 @@ func (r *RDB) EnqueueUnique(msg *base.TaskMessage, ttl time.Duration) error { if err != nil { return err } - err := r.client.SAdd(base.AllQueues, msg.Queue).Err() - if err != nil { + if err := r.client.SAdd(base.AllQueues, msg.Queue).Err(); err != nil { return err } res, err := enqueueUniqueCmd.Run(r.client, @@ -258,8 +256,7 @@ func (r *RDB) Schedule(msg *base.TaskMessage, processAt time.Time) error { if err != nil { return err } - err := r.client.SAdd(base.AllQueues, msg.Queue).Err() - if err != nil { + if err := r.client.SAdd(base.AllQueues, msg.Queue).Err(); err != nil { return err } score := float64(processAt.Unix()) @@ -288,8 +285,7 @@ func (r *RDB) ScheduleUnique(msg *base.TaskMessage, processAt time.Time, ttl tim if err != nil { return err } - err := r.client.SAdd(base.AllQueues, msg.Queue).Err() - if err != nil { + if err := r.client.SAdd(base.AllQueues, msg.Queue).Err(); err != nil { return err } score := float64(processAt.Unix())