diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-10-25 15:32:15 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2023-10-25 13:57:32 +0000 |
| commit | 72e794c46fcfe059006cd6efdf2f6f315a71ff56 (patch) | |
| tree | 1706ce350770aeae4f3940d9384698d7220c1876 /dashboard/app/api.go | |
| parent | 17e6d52686f8a56935991f1b066798279f76504a (diff) | |
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.
Diffstat (limited to 'dashboard/app/api.go')
| -rw-r--r-- | dashboard/app/api.go | 1 |
1 files changed, 1 insertions, 0 deletions
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"). |
