Skip to content

Commit

Permalink
Change config option to cluster_traffic (takes system or account)
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Twigg <[email protected]>
  • Loading branch information
neilalexander committed Jul 30, 2024
1 parent 1d6eaa5 commit 5a8c26e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions server/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2094,12 +2094,19 @@ func parseJetStreamForAccount(v any, acc *Account, errors *[]error) error {
return &configErr{tk, fmt.Sprintf("Expected a parseable size for %q, got %v", mk, mv)}
}
jsLimits.MaxAckPending = int(vv)
case "nrg_in_account":
vv, ok := mv.(bool)
case "cluster_traffic":
vv, ok := mv.(string)
if !ok {
return &configErr{tk, fmt.Sprintf("Expected a boolean for %q, got %v", mk, mv)}
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
}
switch strings.ToLower(vv) {
case "system":
acc.js.accountNRG.Store(false)
case "account":
acc.js.accountNRG.Store(true)
default:
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
}
acc.js.accountNRG.Store(vv)
default:
if !tk.IsUsedVariable() {
err := &unknownConfigFieldErr{
Expand Down

0 comments on commit 5a8c26e

Please sign in to comment.