Skip to content

Commit

Permalink
fix(queue): pop from inRoutes if supplied (#1153)
Browse files Browse the repository at this point in the history
* fix(queue): pop from inRoutes if supplied

* move log message to be accurate

* remove errant line

---------

Co-authored-by: Tim Huynh <[email protected]>
  • Loading branch information
ecrupper and timhuynh94 authored Jun 24, 2024
1 parent 71d4cfd commit b24411e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions queue/redis/pop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b24411e

Please sign in to comment.