diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-01-26 13:54:57 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-01-27 12:33:33 +0300 |
commit | de7c9c7ab17a8b36ca0c645ba1a7a6971a077fb1 (patch) | |
tree | 96254ba55bfe11bbd5ef8221afb1a37369e9737b /app/views/dashboard/projects/index.atom.builder | |
parent | 128a6411d2a60c855e3c99303d0157f436e32f13 (diff) |
Use Atom update times of the first event
By simply loading the first event from the already sorted set we save
ourselves extra (slow) queries just to get the latest update timestamp.
This removes the need for Event.latest_update_time and significantly
reduces the time needed to build an Atom feed.
Fixes gitlab-org/gitlab-ce#12415
Diffstat (limited to 'app/views/dashboard/projects/index.atom.builder')
-rw-r--r-- | app/views/dashboard/projects/index.atom.builder | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/dashboard/projects/index.atom.builder b/app/views/dashboard/projects/index.atom.builder index 2e2712c5146..d4daf07c6c0 100644 --- a/app/views/dashboard/projects/index.atom.builder +++ b/app/views/dashboard/projects/index.atom.builder @@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear xml.link href: dashboard_projects_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html" xml.id dashboard_projects_url - xml.updated @events.latest_update_time.xmlschema if @events.any? + xml.updated @events[0].updated_at.xmlschema if @events[0] @events.each do |event| event_to_atom(xml, event) |