[ARVADOS] created: 4da754586b4529a4480951218a69ec6f41fee98d
Git user
git at public.curoverse.com
Fri Sep 30 10:59:18 EDT 2016
at 4da754586b4529a4480951218a69ec6f41fee98d (commit)
commit 4da754586b4529a4480951218a69ec6f41fee98d
Author: radhika <radhika at curoverse.com>
Date: Fri Sep 30 10:40:41 2016 -0400
10078: Update recent_collections so that the collection query it is not executed twice, once in this method and once in show_dashboard for r[:collections].each statement.
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index a8431a7..9d04708 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -318,6 +318,3 @@ DEPENDENCIES
therubyracer
uglifier (>= 1.0.3)
wiselinks
-
-BUNDLED WITH
- 1.12.1
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 0da5956..3886d1c 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -867,7 +867,7 @@ class ApplicationController < ActionController::Base
helper_method :recent_collections
def recent_collections lim
- c = Collection.limit(lim).order(["modified_at desc"]).filter([["owner_uuid", "is_a", "arvados#group"]])
+ c = Collection.limit(lim).order(["modified_at desc"]).results
own = {}
Group.filter([["uuid", "in", c.map(&:owner_uuid)]]).each do |g|
own[g[:uuid]] = g
commit 84f3d7048e63fc88b39f329ac5472238df2edc3d
Author: radhika <radhika at curoverse.com>
Date: Fri Sep 30 10:36:07 2016 -0400
10078: Update the Node.filter so that this query is not executed three times: once for nodes.sort_by and twice in compute_node_summary for nodes.select
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index c02577f..806ed8a 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -106,7 +106,7 @@
</div>
<div class="col-md-6">
- <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]) %>
+ <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]).results %>
<div class="panel panel-default" style="min-height: 10.5em">
<div class="panel-heading"><span class="panel-title">Compute node status</span>
<span class="pull-right compute-node-actions">
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list