From de7c9c7ab17a8b36ca0c645ba1a7a6971a077fb1 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 26 Jan 2016 11:54:57 +0100 Subject: 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 --- app/views/projects/show.atom.builder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects/show.atom.builder') diff --git a/app/views/projects/show.atom.builder b/app/views/projects/show.atom.builder index d6762219108..2468509242a 100644 --- a/app/views/projects/show.atom.builder +++ b/app/views/projects/show.atom.builder @@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear xml.link href: namespace_project_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html" xml.id namespace_project_url(@project.namespace, @project) - 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) -- cgit v1.2.1