diff options
author | Rémy Coutable <remy@rymai.me> | 2017-09-26 17:06:49 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-26 17:06:49 +0000 |
commit | 3b2d68d37d39047e25fbe0ae51cafa39f22805f8 (patch) | |
tree | 9ecac66eaa31ccaedaad671cc5984e5419b5800b | |
parent | dfccc8d7b2eae0d00b946302c07d25fa9cc0ff91 (diff) | |
parent | e4b69bc231c62814874ecff5ed85e9003ad6dddd (diff) | |
download | gitlab-ce-3b2d68d37d39047e25fbe0ae51cafa39f22805f8.tar.gz |
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
-rw-r--r-- | app/models/repository.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 90cede9d3d4..b28fe79e19c 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -534,8 +534,11 @@ class Repository cache_method :tag_count, fallback: 0 def avatar - if tree = file_on_head(:avatar) - tree.path + # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/38327 + Gitlab::GitalyClient.allow_n_plus_1_calls do + if tree = file_on_head(:avatar) + tree.path + end end end cache_method :avatar |