From d5eb48b4e61d9a769f4f803260c758cda07e8556 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 14 Oct 2022 10:00:06 +0100 Subject: [PATCH 1/2] Update `InactiveThreshold` comments These hadn't been updated after nats-io/nats-server#3190 seemingly. --- js.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js.go b/js.go index 05555cc31..3517578ce 100644 --- a/js.go +++ b/js.go @@ -1088,7 +1088,7 @@ type ConsumerConfig struct { DeliverSubject string `json:"deliver_subject,omitempty"` DeliverGroup string `json:"deliver_group,omitempty"` - // Ephemeral inactivity threshold. + // Inactivity threshold. InactiveThreshold time.Duration `json:"inactive_threshold,omitempty"` // Generally inherited by parent stream and other markers, now can be configured directly. @@ -2465,8 +2465,12 @@ func MaxRequestMaxBytes(bytes int) SubOpt { }) } -// InactiveThreshold indicates how long the server should keep an ephemeral -// after detecting loss of interest. +// InactiveThreshold indicates how long the server should keep an consumer +// after detecting a loss of interest. In NATS Server 2.8.4 and earlier, this +// option only applies to ephemeral consumers. In NATS Server 2.9.0 and later, +// this option applies to both ephemeral and durable consumers, allowing durable +// consumers to also be deleted automatically after the inactivity threshold has +// passed. func InactiveThreshold(threshold time.Duration) SubOpt { return subOptFn(func(opts *subOpts) error { if threshold < 0 { From 0689e7a34cc413b8d9bddafba5753f62f75fa0a7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 15 Oct 2022 12:05:25 +0100 Subject: [PATCH 2/2] Review comments --- js.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js.go b/js.go index 3517578ce..cf62a9d05 100644 --- a/js.go +++ b/js.go @@ -2465,8 +2465,8 @@ func MaxRequestMaxBytes(bytes int) SubOpt { }) } -// InactiveThreshold indicates how long the server should keep an consumer -// after detecting a loss of interest. In NATS Server 2.8.4 and earlier, this +// InactiveThreshold indicates how long the server should keep a consumer +// after detecting a lack of activity. In NATS Server 2.8.4 and earlier, this // option only applies to ephemeral consumers. In NATS Server 2.9.0 and later, // this option applies to both ephemeral and durable consumers, allowing durable // consumers to also be deleted automatically after the inactivity threshold has