Dashboard Provisioning: Reduce db load (#106114)

This commit is contained in:
Stephanie Hingtgen
2025-05-29 09:39:07 +03:00
committed by GitHub
parent 3de80ec3d7
commit ab99211b40
11 changed files with 491 additions and 351 deletions
@@ -297,15 +297,15 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
require.Equal(t, res[0], provisioningData)
// get dashboards within the provisioner
dashs, err := dashboardStore.GetProvisionedDashboardsByName(context.Background(), "test", 1)
provisionedDashes, err := dashboardStore.GetProvisionedDashboardsByName(context.Background(), "test", 1)
require.NoError(t, err)
require.Len(t, dashs, 1)
dashs, err = dashboardStore.GetProvisionedDashboardsByName(context.Background(), "test", 2)
require.Len(t, provisionedDashes, 1)
provisionedDashes, err = dashboardStore.GetProvisionedDashboardsByName(context.Background(), "test", 2)
require.NoError(t, err)
require.Len(t, dashs, 0)
require.Len(t, provisionedDashes, 0)
// find dashboards not within that provisioner
dashs, err = dashboardStore.GetOrphanedProvisionedDashboards(context.Background(), []string{"test"}, 1)
dashs, err := dashboardStore.GetOrphanedProvisionedDashboards(context.Background(), []string{"test"}, 1)
require.NoError(t, err)
require.Len(t, dashs, 1)
dashs, err = dashboardStore.GetOrphanedProvisionedDashboards(context.Background(), []string{"test"}, 2)