Skip to content

Commit 2f752ac

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

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
@@ -2112,12 +2112,19 @@ func parseJetStreamForAccount(v any, acc *Account, errors *[]error) error {
21122112
return &configErr{tk, fmt.Sprintf("Expected a parseable size for %q, got %v", mk, mv)}
21132113
}
21142114
jsLimits.MaxAckPending = int(vv)
2115-
case "nrg_in_account":
2116-
vv, ok := mv.(bool)
2115+
case "cluster_traffic":
2116+
vv, ok := mv.(string)
21172117
if !ok {
2118-
return &configErr{tk, fmt.Sprintf("Expected a boolean for %q, got %v", mk, mv)}
2118+
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
2119+
}
2120+
switch strings.ToLower(vv) {
2121+
case "system":
2122+
acc.js.accountNRG.Store(false)
2123+
case "account":
2124+
acc.js.accountNRG.Store(true)
2125+
default:
2126+
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
21192127
}
2120-
acc.js.accountNRG.Store(vv)
21212128
default:
21222129
if !tk.IsUsedVariable() {
21232130
err := &unknownConfigFieldErr{

0 commit comments

Comments
 (0)