Skip to content

Commit 13cf07d

Browse files
committed
NOC shows info about Bourreaux
When a Bourreau was active but not updated in the past month, it would disappear from the NOC. Fixed here.
1 parent 4502912 commit 13cf07d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

BrainPortal/app/controllers/noc_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ def gather_info(since_when) #:nodoc:
200200

201201
# RemoteResources, including the portal itself
202202
@myself = RemoteResource.current_resource
203-
@bourreaux = Bourreau.where([ "updated_at > ?", offline_resource_limit.ago ]).order(:name).all # must have been toggled within a month
203+
acttasks_bids = CbrainTask.active.group(:bourreau_id).pluck(:bourreau_id)
204+
updated_bids = Bourreau.where([ "updated_at > ?", offline_resource_limit.ago ]).pluck(:id) # must have been toggled within a month.
205+
@bourreaux = Bourreau.where(:id => (acttasks_bids | updated_bids)).order(:name).all
204206

205207
# Some numbers: active users, active tasks, sum of files sizes being transferred, sum of CPU time
206208
@active_users = CbrainSession.session_model

0 commit comments

Comments
 (0)