diff --git a/serverkeyapi/api/api.go b/serverkeyapi/api/api.go index 48513621f..a261d70c0 100644 --- a/serverkeyapi/api/api.go +++ b/serverkeyapi/api/api.go @@ -70,9 +70,10 @@ func (s *httpServerKeyInternalAPI) FetcherName() string { } func (s *httpServerKeyInternalAPI) StoreKeys( - ctx context.Context, + _ context.Context, results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, ) error { + ctx := context.Background() request := InputPublicKeysRequest{ Keys: make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult), } @@ -85,9 +86,10 @@ func (s *httpServerKeyInternalAPI) StoreKeys( } func (s *httpServerKeyInternalAPI) FetchKeys( - ctx context.Context, + _ context.Context, requests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp, ) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error) { + ctx := context.Background() result := make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult) request := QueryPublicKeysRequest{ Requests: make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp), diff --git a/serverkeyapi/internal/api.go b/serverkeyapi/internal/api.go index 487c58920..9e8ab1fb9 100644 --- a/serverkeyapi/internal/api.go +++ b/serverkeyapi/internal/api.go @@ -25,17 +25,19 @@ func (s *ServerKeyAPI) KeyRing() *gomatrixserverlib.KeyRing { } func (s *ServerKeyAPI) StoreKeys( - ctx context.Context, + _ context.Context, results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, ) error { + ctx := context.Background() // Store any keys that we were given in our database. return s.OurKeyRing.KeyDatabase.StoreKeys(ctx, results) } func (s *ServerKeyAPI) FetchKeys( - ctx context.Context, + _ context.Context, requests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp, ) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error) { + ctx := context.Background() results := map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult{} // First consult our local database and see if we have the requested // keys. These might come from a cache, depending on the database