Commit b0b7c008 authored by Stan Hu's avatar Stan Hu

Check whether Geo is enabled before checking whether avatar exists

We see in some profiles, that this additional check adds 1% to
the page load.
parent 90c1f1f2
......@@ -5,7 +5,7 @@ module EE
# and be **prepended** in the `Group`, `User`, `Project` models
module GeoAwareAvatar
def avatar_url(size = nil, scale = 2)
if self[:avatar].present? && ::Gitlab::Geo.secondary?
if ::Gitlab::Geo.secondary? && self[:avatar].present?
File.join(::Gitlab::Geo.primary_node.url, avatar.url)
else
super
......
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