Skip to content

Commit

Permalink
Merge pull request #3781 from nats-io/neil/updateleafdelta
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Jan 12, 2023
2 parents d95c143 + 3b29ce4 commit 4d52135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/leafnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ func (c *client) updateSmap(sub *subscription, delta int32) {

n := c.leaf.smap[key]
// We will update if its a queue, if count is zero (or negative), or we were 0 and are N > 0.
update := sub.queue != nil || n == 0 || n+delta <= 0
update := sub.queue != nil || (n <= 0 && n+delta > 0) || (n > 0 && n+delta <= 0)
n += delta
if n > 0 {
c.leaf.smap[key] = n
Expand Down

0 comments on commit 4d52135

Please sign in to comment.