Skip to content

Commit 662c4fd

Browse files
committed
Change config option to cluster_traffic (takes system or account)
Signed-off-by: Neil Twigg <[email protected]>
1 parent ab9ed39 commit 662c4fd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

server/opts.go

+11-4
Original file line numberDiff line numberDiff line change
@@ -2128,12 +2128,19 @@ func parseJetStreamForAccount(v any, acc *Account, errors *[]error) error {
21282128
return &configErr{tk, fmt.Sprintf("Expected a parseable size for %q, got %v", mk, mv)}
21292129
}
21302130
jsLimits.MaxAckPending = int(vv)
2131-
case "nrg_in_account":
2132-
vv, ok := mv.(bool)
2131+
case "cluster_traffic":
2132+
vv, ok := mv.(string)
21332133
if !ok {
2134-
return &configErr{tk, fmt.Sprintf("Expected a boolean for %q, got %v", mk, mv)}
2134+
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
2135+
}
2136+
switch strings.ToLower(vv) {
2137+
case "system":
2138+
acc.js.accountNRG.Store(false)
2139+
case "account":
2140+
acc.js.accountNRG.Store(true)
2141+
default:
2142+
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
21352143
}
2136-
acc.js.accountNRG.Store(vv)
21372144
default:
21382145
if !tk.IsUsedVariable() {
21392146
err := &unknownConfigFieldErr{

0 commit comments

Comments
 (0)