Commit ee4733dd authored by David Fernandez's avatar David Fernandez

Merge branch 'sh-memoize-namespace-usage' into 'master'

Memoize namespace monthly usage to reduce SQL queries

See merge request gitlab-org/gitlab!68219
parents 40a2b67e f558ca40
......@@ -58,7 +58,9 @@ module Ci
end
def namespace_usage
::Ci::Minutes::NamespaceMonthlyUsage.find_or_create_current(namespace_id: @namespace_id)
strong_memoize(:namespace_usage) do
::Ci::Minutes::NamespaceMonthlyUsage.find_or_create_current(namespace_id: @namespace_id)
end
end
def project_usage
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment