Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(queue): pop from inRoutes if supplied #1153

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

toolchain go1.22.4

replace github.com/go-vela/server => ../server

Check failure on line 7 in go.mod

View workflow job for this annotation

GitHub Actions / golangci

[golangci] go.mod#L7

local replacement are not allowed: github.com/go-vela/server (gomoddirectives)
Raw output
go.mod:7:1: local replacement are not allowed: github.com/go-vela/server (gomoddirectives)
replace github.com/go-vela/server => ../server
^
wass3r marked this conversation as resolved.
Show resolved Hide resolved

require (
github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb
github.com/DATA-DOG/go-sqlmock v1.5.2
Expand Down
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
Loading