Skip to content

Commit 5a8c26e

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

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
@@ -2094,12 +2094,19 @@ func parseJetStreamForAccount(v any, acc *Account, errors *[]error) error {
20942094
return &configErr{tk, fmt.Sprintf("Expected a parseable size for %q, got %v", mk, mv)}
20952095
}
20962096
jsLimits.MaxAckPending = int(vv)
2097-
case "nrg_in_account":
2098-
vv, ok := mv.(bool)
2097+
case "cluster_traffic":
2098+
vv, ok := mv.(string)
20992099
if !ok {
2100-
return &configErr{tk, fmt.Sprintf("Expected a boolean for %q, got %v", mk, mv)}
2100+
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
2101+
}
2102+
switch strings.ToLower(vv) {
2103+
case "system":
2104+
acc.js.accountNRG.Store(false)
2105+
case "account":
2106+
acc.js.accountNRG.Store(true)
2107+
default:
2108+
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
21012109
}
2102-
acc.js.accountNRG.Store(vv)
21032110
default:
21042111
if !tk.IsUsedVariable() {
21052112
err := &unknownConfigFieldErr{

0 commit comments

Comments
 (0)