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 Aug 7, 2024
1 parent ab9ed39 commit 662c4fd
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 @@ -2128,12 +2128,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 662c4fd

Please sign in to comment.