From 69dda500a40e81722803c78be84fa780900e3a8f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 25 Jun 2013 12:07:16 +0200 Subject: [PATCH] SONAR-4439 OutOfMemory in the page "Clouds" --- .../WEB-INF/app/controllers/cloud_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb index 9f642d23dff..3c1fd751590 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb @@ -44,18 +44,19 @@ class CloudController < ApplicationController @snapshots=Snapshot.find(:all, :conditions => [snapshot_conditions, snapshot_values], :include => 'project', :order => 'projects.name') size_measures=ProjectMeasure.find(:all, - :select => 'project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.rule_priority,project_measures.text_value,project_measures.characteristic_id,project_measures.alert_status', + :select => 'project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.text_value,project_measures.characteristic_id,project_measures.alert_status', :joins => :snapshot, - :conditions => [snapshot_conditions + " AND project_measures.metric_id=#{@size_metric.id}", snapshot_values], + :conditions => [snapshot_conditions + " AND project_measures.metric_id=#{@size_metric.id} AND project_measures.rule_id IS NULL AND project_measures.characteristic_id IS NULL AND project_measures.person_id IS NULL", snapshot_values], :order => 'project_measures.value') color_measures=ProjectMeasure.find(:all, - :select => 'project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.rule_priority,project_measures.text_value,project_measures.characteristic_id,project_measures.alert_status', + :select => 'project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.text_value,project_measures.characteristic_id,project_measures.alert_status', :joins => :snapshot, - :conditions => [snapshot_conditions + " AND project_measures.metric_id=#{@color_metric.id} AND project_measures.rule_id IS NULL AND "+ "project_measures.characteristic_id IS NULL AND project_measures.person_id IS NULL", snapshot_values], + :conditions => [snapshot_conditions + " AND project_measures.metric_id=#{@color_metric.id} AND project_measures.rule_id IS NULL AND project_measures.characteristic_id IS NULL AND project_measures.person_id IS NULL", snapshot_values], :order => 'project_measures.value') - @size_measure_by_sid={}, @color_measure_by_sid={} + @size_measure_by_sid={} + @color_measure_by_sid={} size_measures.each do |m| @size_measure_by_sid[m.snapshot_id]=m end -- 2.39.5