From b24411e189d642d3c59c75b33797a022d05aac8e Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:28:03 -0400 Subject: [PATCH] fix(queue): pop from inRoutes if supplied (#1153) * fix(queue): pop from inRoutes if supplied * move log message to be accurate * remove errant line --------- Co-authored-by: Tim Huynh --- queue/redis/pop.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/queue/redis/pop.go b/queue/redis/pop.go index 7c5658029..36592b463 100644 --- a/queue/redis/pop.go +++ b/queue/redis/pop.go @@ -15,18 +15,18 @@ import ( // Pop grabs an item from the specified channel off the queue. func (c *client) Pop(ctx context.Context, inRoutes []string) (*models.Item, error) { - c.Logger.Tracef("popping item from queue %s", c.GetRoutes()) - // define routes to pop from var routes []string // if routes were supplied, use those - if len(routes) > 0 { + if len(inRoutes) > 0 { routes = inRoutes } else { routes = c.GetRoutes() } + c.Logger.Tracef("popping item from queue %s", routes) + // build a redis queue command to pop an item from queue // // https://pkg.go.dev/github.com/go-redis/redis?tab=doc#Client.BLPop