mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Make sure PushActive is nil for pull consumers
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1477,7 +1477,7 @@ func (o *consumer) info() *ConsumerInfo {
|
||||
return nil
|
||||
}
|
||||
js := o.js
|
||||
if o.active {
|
||||
if o.isPushMode() && o.active {
|
||||
pa = &PushActive{
|
||||
Subject: o.dsubj,
|
||||
Queue: o.qgroup,
|
||||
|
||||
@@ -11860,6 +11860,7 @@ func TestJetStreamPushConsumerInfo(t *testing.T) {
|
||||
Config: ConsumerConfig{
|
||||
Durable: name,
|
||||
DeliverSubject: deliver,
|
||||
AckPolicy: AckExplicit,
|
||||
},
|
||||
}
|
||||
req, err := json.Marshal(creq)
|
||||
@@ -11928,6 +11929,12 @@ func TestJetStreamPushConsumerInfo(t *testing.T) {
|
||||
if ci := consumerInfo("ik"); ci.Active != nil {
|
||||
t.Fatalf("Expected active to be nil, got %+v\n", ci.Active)
|
||||
}
|
||||
|
||||
// Make sure pull consumers report Active as nil.
|
||||
createConsumer("rip", _EMPTY_)
|
||||
if ci := consumerInfo("rip"); ci.Active != nil {
|
||||
t.Fatalf("Expected active to be nil, got %+v\n", ci.Active)
|
||||
}
|
||||
}
|
||||
|
||||
// Issue #2213
|
||||
|
||||
Reference in New Issue
Block a user