From 72e794c46fcfe059006cd6efdf2f6f315a71ff56 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 25 Oct 2023 15:32:15 +0200 Subject: dashboard: cache per-ns manager lists The query may take up to 100ms in some cases, while the result changes on quite rare occasions. Let's use a cached version of the data when rendering UI pages. We don't need extra tests because it's already excercised in existing tests that trigger web endpoints. --- dashboard/app/api.go | 1 + 1 file changed, 1 insertion(+) (limited to 'dashboard/app/api.go') diff --git a/dashboard/app/api.go b/dashboard/app/api.go index a51a2328e..2dce92d55 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -642,6 +642,7 @@ func bugNeedsCommitUpdate(c context.Context, bug *Bug, manager string, fixCommit return true } +// Note: if you do not need the latest data, prefer CachedManagersList(). func managerList(c context.Context, ns string) ([]string, error) { var builds []*Build _, err := db.NewQuery("Build"). -- cgit mrf-deployment