From a1879195a727d7b90347ed11f86d85fac6541df7 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 10 Jul 2024 14:39:34 +0200 Subject: Client + Discovery: Fetch dscovery at startup using DiscoveryStartup With a manager that locks and copies such that no race conditions happen --- internal/server/secureinternet.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'internal/server') diff --git a/internal/server/secureinternet.go b/internal/server/secureinternet.go index f167756..990ceb3 100644 --- a/internal/server/secureinternet.go +++ b/internal/server/secureinternet.go @@ -34,8 +34,10 @@ func (s *Servers) AddSecure(ctx context.Context, disco *discovery.Discovery, org BaseWK: dsrv.BaseURL, BaseAuthWK: dsrv.BaseURL, ProcessAuth: func(ctx context.Context, url string) (string, error) { - disco.Servers(ctx) - disco.Organizations(ctx) + // the only thing we can do is log warn + // this is already done in the functions + disco.Servers(ctx) //nolint:errcheck + disco.Organizations(ctx) //nolint:errcheck updorg, updsrv, err := disco.SecureHomeArgs(orgID) if err != nil { return "", err @@ -104,10 +106,12 @@ func (s *Servers) GetSecure(ctx context.Context, orgID string, disco *discovery. BaseWK: dloc.BaseURL, BaseAuthWK: dhome.BaseURL, ProcessAuth: func(ctx context.Context, url string) (string, error) { + // the only thing we can do is log warn + // this is already done in the functions disco.MarkServersExpired() - disco.Servers(ctx) + disco.Servers(ctx) //nolint:errcheck disco.MarkOrganizationsExpired() - disco.Organizations(ctx) + disco.Organizations(ctx) //nolint:errcheck updorg, updsrv, err := disco.SecureHomeArgs(orgID) if err != nil { return "", err -- cgit v1.2.3