From c931b8031e28092764b288a5183ba4c68970fc2c Mon Sep 17 00:00:00 2001 From: Karl Persson Date: Fri, 27 Jan 2023 14:40:04 +0100 Subject: [PATCH] SearchV2: Set correct batch limit when loading dashboards (#62314) SearchV2: Set correct limit --- pkg/services/searchV2/index.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/services/searchV2/index.go b/pkg/services/searchV2/index.go index 2ea2540aa47..0c15395cd55 100644 --- a/pkg/services/searchV2/index.go +++ b/pkg/services/searchV2/index.go @@ -901,7 +901,8 @@ func (l sqlDashboardLoader) LoadDashboards(ctx context.Context, orgID int64, das limit := 1 if dashboardUID == "" { - dashboards = make([]dashboard, 0, l.settings.DashboardLoadingBatchSize) + limit = l.settings.DashboardLoadingBatchSize + dashboards = make([]dashboard, 0, limit) } loadDatasourceCtx, loadDatasourceSpan := l.tracer.Start(ctx, "sqlDashboardLoader LoadDatasourceLookup")