Stats: Optimize getting folder stats (#103033)

This commit is contained in:
Stephanie Hingtgen
2025-03-28 20:17:50 -05:00
committed by GitHub
parent 28b142e951
commit f84654d162
16 changed files with 109 additions and 27 deletions
+8
View File
@@ -202,6 +202,14 @@ func (s *Service) DBMigration(db db.DB) {
s.log.Debug("syncing dashboard and folder tables finished")
}
func (s *Service) CountFoldersInOrg(ctx context.Context, orgID int64) (int64, error) {
if s.features.IsEnabledGlobally(featuremgmt.FlagKubernetesClientDashboardsFolders) {
return s.unifiedStore.CountInOrg(ctx, orgID)
}
return s.store.CountInOrg(ctx, orgID)
}
func (s *Service) SearchFolders(ctx context.Context, q folder.SearchFoldersQuery) (model.HitList, error) {
if s.features.IsEnabledGlobally(featuremgmt.FlagKubernetesClientDashboardsFolders) {
// TODO: