Zanzana: Lazy load cached store info (#96452)

* Lazy load cached store infos
This commit is contained in:
Karl Persson
2024-11-15 11:44:34 +01:00
committed by GitHub
parent 76a3d79231
commit 7e38fd733b
7 changed files with 64 additions and 151 deletions
@@ -13,13 +13,10 @@ func (s *Server) Write(ctx context.Context, req *authzextv1.WriteRequest) (*auth
ctx, span := tracer.Start(ctx, "authzServer.Write")
defer span.End()
storeInf, err := s.getNamespaceStore(ctx, req.Namespace)
storeInf, err := s.getStoreInfo(ctx, req.Namespace)
if err != nil {
return nil, err
}
if storeInf.AuthorizationModelId == "" {
return nil, errAuthorizationModelNotInitialized
}
writeTuples := make([]*openfgav1.TupleKey, 0)
for _, t := range req.GetWrites().GetTupleKeys() {