Merge pull request #498 from gabriel-samfira/preload-more-info

Preload more info for entity pools
This commit is contained in:
Gabriel 2025-08-27 12:27:04 +03:00 committed by GitHub
commit e3a9fe7026
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,7 +343,17 @@ func (s *sqlDatabase) CreateEntityPool(ctx context.Context, entity params.ForgeE
} }
func (s *sqlDatabase) GetEntityPool(_ context.Context, entity params.ForgeEntity, poolID string) (params.Pool, error) { func (s *sqlDatabase) GetEntityPool(_ context.Context, entity params.ForgeEntity, poolID string) (params.Pool, error) {
pool, err := s.getEntityPool(s.conn, entity.EntityType, entity.ID, poolID, "Tags", "Instances") preloadList := []string{
"Tags",
"Instances",
"Enterprise",
"Enterprise.Endpoint",
"Organization",
"Organization.Endpoint",
"Repository",
"Repository.Endpoint",
}
pool, err := s.getEntityPool(s.conn, entity.EntityType, entity.ID, poolID, preloadList...)
if err != nil { if err != nil {
return params.Pool{}, fmt.Errorf("fetching pool: %w", err) return params.Pool{}, fmt.Errorf("fetching pool: %w", err)
} }