Skip to content

Commit

Permalink
get client once
Browse files Browse the repository at this point in the history
  • Loading branch information
asiyani committed Aug 7, 2024
1 parent fef7608 commit 891b2f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ func run(c *cli.Context) {
logger.Info("OIDC authentication configured", "issuer", c.String("oidc-issuer"), "clientID", c.String("oidc-client-id"))
}

go func() {
if err := metrics.CollectModuleInfo(ctx, mgr.GetClient()); err != nil {
go func(client client.Client) {
if err := metrics.CollectModuleInfo(ctx, client); err != nil {
logger.Error("unable to collect module info metrics", "error", err)
}

Expand All @@ -729,14 +729,14 @@ func run(c *cli.Context) {
for {
select {
case <-ticker.C:
if err := metrics.CollectModuleInfo(ctx, mgr.GetClient()); err != nil {
if err := metrics.CollectModuleInfo(ctx, client); err != nil {
logger.Error("unable to collect module info metrics", "error", err)
}
case <-ctx.Done():
return
}
}
}()
}(mgr.GetClient())

webserver := &webserver.WebServer{
Authenticator: oidcAuthenticator,
Expand Down

0 comments on commit 891b2f5

Please sign in to comment.