Merge branch 'avatar_n_plus_one' into 'master'
Allow n+1s caused by avatar fetches on the project dashboard. See… See merge request gitlab-org/gitlab-ce!14475
This commit is contained in:
commit
3b2d68d37d
|
@ -534,8 +534,11 @@ class Repository
|
||||||
cache_method :tag_count, fallback: 0
|
cache_method :tag_count, fallback: 0
|
||||||
|
|
||||||
def avatar
|
def avatar
|
||||||
if tree = file_on_head(:avatar)
|
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/38327
|
||||||
tree.path
|
Gitlab::GitalyClient.allow_n_plus_1_calls do
|
||||||
|
if tree = file_on_head(:avatar)
|
||||||
|
tree.path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
cache_method :avatar
|
cache_method :avatar
|
||||||
|
|
Loading…
Reference in New Issue