Skip to content

Commit

Permalink
[FIX] generate command has a generic processing engine but when gener…
Browse files Browse the repository at this point in the history
…ating anything but nkey configurations, it shouldn't look at the users as this could significantly degrate generation performance when that data is not needed. (#624)
  • Loading branch information
aricart authored Nov 13, 2023
1 parent dc5966c commit 98665d7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions cmd/generateserverconfig.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2022 The NATS Authors
* Copyright 2018-2023 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down Expand Up @@ -249,16 +249,18 @@ func (p *GenerateServerConfigParams) Run(ctx ActionCtx) (store.Status, error) {
}
p.generator.Add(d)

users, err := s.ListEntries(store.Accounts, n, store.Users)
if err != nil {
return nil, err
}
for _, u := range users {
d, err := s.Read(store.Accounts, n, store.Users, store.JwtName(u))
if p.nkeyConfig {
users, err := s.ListEntries(store.Accounts, n, store.Users)
if err != nil {
return nil, err
}
p.generator.Add(d)
for _, u := range users {
d, err := s.Read(store.Accounts, n, store.Users, store.JwtName(u))
if err != nil {
return nil, err
}
p.generator.Add(d)
}
}
}

Expand Down

0 comments on commit 98665d7

Please sign in to comment.