From 132782f44603dfdc3b1d875d632f786109ee09a2 Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Fri, 29 Aug 2025 14:36:00 +0200 Subject: Discovery: Remove manager and DiscoveryStartup --- internal/server/institute.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'internal/server/institute.go') diff --git a/internal/server/institute.go b/internal/server/institute.go index 348e895..0a7ef3a 100644 --- a/internal/server/institute.go +++ b/internal/server/institute.go @@ -17,15 +17,12 @@ import ( // `disco` are the discovery servers // `id` is the identifier for the server, the base url // `ot` specifies specifies the start time OAuth was already triggered -func (s *Servers) AddInstitute(ctx context.Context, discom *discovery.Manager, id string, ot *int64) error { +func (s *Servers) AddInstitute(ctx context.Context, disco *discovery.Discovery, id string, ot *int64) error { // This is basically done to double check if the server is part of the institute access section of disco - disco, release := discom.Discovery(false) dsrv, err := disco.ServerByURL(id, "institute_access") if err != nil { - release() return err } - release() sd := api.ServerData{ ID: dsrv.BaseURL, @@ -70,15 +67,12 @@ func (s *Servers) AddInstitute(ctx context.Context, discom *discovery.Manager, i // `disco` are the discovery servers // `tok` are the tokens such that we do not have to trigger auth // `disableAuth` is true when auth should never be triggered -func (s *Servers) GetInstitute(ctx context.Context, id string, discom *discovery.Manager, tok *eduoauth.Token, disableAuth bool) (*Server, error) { - disco, release := discom.Discovery(false) +func (s *Servers) GetInstitute(ctx context.Context, id string, disco *discovery.Discovery, tok *eduoauth.Token, disableAuth bool) (*Server, error) { // This is basically done to double check if the server is part of the institute access section of disco dsrv, err := disco.ServerByURL(id, "institute_access") if err != nil { - release() return nil, err } - release() // Get the server from the config _, err = s.config.GetServer(dsrv.BaseURL, server.TypeInstituteAccess) -- cgit v1.2.3