Skip to content

Commit

Permalink
fix: bin/harvest rest should read credentials before fetching data
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrinds committed Sep 23, 2024
1 parent 2bc188c commit 0cbc37f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/tools/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,17 @@ func doData() {
pollers = append(pollers, args.Poller)
}

// Prime the credential cache before forking goroutines
for _, pollerName := range pollers {
p, _, err := GetPollerAndAddr(pollerName)
if err != nil {
stderr("failed to get poller %s err: %+v\n", pollers[0], err)
continue
}
cred := auth.NewCredentials(p, slog.Default())
_, _ = cred.GetPollerAuth()
}

for _, pollerName := range pollers {
go func(pollerName string) {
var (
Expand Down

0 comments on commit 0cbc37f

Please sign in to comment.