From 84d7760cbea93b26a1046e7ba26f262dcb702392 Mon Sep 17 00:00:00 2001 From: "R.I.Pienaar" Date: Tue, 19 Nov 2024 15:44:47 +0100 Subject: [PATCH] Fix pin check activation Signed-off-by: R.I.Pienaar --- consumer_query.go | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/consumer_query.go b/consumer_query.go index cea59a2..03b3abb 100644 --- a/consumer_query.go +++ b/consumer_query.go @@ -300,7 +300,7 @@ func (q *consumerQuery) matchWaiting(consumers []*Consumer) ([]*Consumer, error) } func (q *consumerQuery) matchPinned(consumers []*Consumer) ([]*Consumer, error) { - return q.cbMatcher(consumers, q.isBound != nil, func(consumer *Consumer) bool { + return q.cbMatcher(consumers, q.isPinned != nil, func(consumer *Consumer) bool { if !consumer.IsPinnedClientPriority() { return false } @@ -313,7 +313,7 @@ func (q *consumerQuery) matchPinned(consumers []*Consumer) ([]*Consumer, error) pinned++ } } - isPinned := pinned == len(nfo.PriorityGroups) + isPinned := pinned == len(nfo.Config.PriorityGroups) return (!q.invert && isPinned) || (q.invert && !isPinned) }) diff --git a/go.mod b/go.mod index 42212fc..9e9f8ff 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/jedib0t/go-pretty/v6 v6.6.1 github.com/klauspost/compress v1.17.11 github.com/nats-io/jwt/v2 v2.7.2 - github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241113003423-e1b2f5d9854d + github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241119025009-2dadd723643c github.com/nats-io/nats.go v1.37.0 github.com/nats-io/nkeys v0.4.7 github.com/nats-io/nuid v1.0.1 diff --git a/go.sum b/go.sum index 9bb52a1..b7a72b7 100644 --- a/go.sum +++ b/go.sum @@ -29,8 +29,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nats-io/jwt/v2 v2.7.2 h1:SCRjfDLJ2q8naXp8YlGJJS5/yj3wGSODFYVi4nnwVMw= github.com/nats-io/jwt/v2 v2.7.2/go.mod h1:kB6QUmqHG6Wdrzj0KP2L+OX4xiTPBeV+NHVstFaATXU= -github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241113003423-e1b2f5d9854d h1:tT1pVgPadut3ryD7sr+Eh1nMTseYA0FliZ89/TWE8Ew= -github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241113003423-e1b2f5d9854d/go.mod h1:UMry3yQXAiKBN3yh82BS4HxJWF9ht4sbRQyZ1qXODqc= +github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241119025009-2dadd723643c h1:lcnWooJpdDKowjjijNW5LCTGRjInR4rpAecFVXxoOZQ= +github.com/nats-io/nats-server/v2 v2.11.0-dev.0.20241119025009-2dadd723643c/go.mod h1:UMry3yQXAiKBN3yh82BS4HxJWF9ht4sbRQyZ1qXODqc= github.com/nats-io/nats.go v1.37.0 h1:07rauXbVnnJvv1gfIyghFEo6lUcYRY0WXc3x7x0vUxE= github.com/nats-io/nats.go v1.37.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI=