projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 6859-fix-invalid-manifests
[arvados.git]
/
services
/
api
/
app
/
controllers
/
arvados
/
v1
/
nodes_controller.rb
diff --git
a/services/api/app/controllers/arvados/v1/nodes_controller.rb
b/services/api/app/controllers/arvados/v1/nodes_controller.rb
index efee982e74bcf7d62a8baac4561ee0da399dbd3e..4ab5695a2f1c607f22bec9bd1948d575c73fd29e 100644
(file)
--- a/
services/api/app/controllers/arvados/v1/nodes_controller.rb
+++ b/
services/api/app/controllers/arvados/v1/nodes_controller.rb
@@
-3,6
+3,8
@@
class Arvados::V1::NodesController < ApplicationController
skip_before_filter :find_object_by_uuid, :only => :ping
skip_before_filter :render_404_if_no_object, :only => :ping
skip_before_filter :find_object_by_uuid, :only => :ping
skip_before_filter :render_404_if_no_object, :only => :ping
+ include DbCurrentTime
+
def update
if resource_attrs[:job_uuid]
@object.job_readable = readable_job_uuids(resource_attrs[:job_uuid]).any?
def update
if resource_attrs[:job_uuid]
@object.job_readable = readable_job_uuids(resource_attrs[:job_uuid]).any?
@@
-30,7
+32,7
@@
class Arvados::V1::NodesController < ApplicationController
end
@object.ping(ping_data)
if @object.info['ping_secret'] == params[:ping_secret]
end
@object.ping(ping_data)
if @object.info['ping_secret'] == params[:ping_secret]
-
render json:
@object.as_api_response(:superuser)
+
send_json
@object.as_api_response(:superuser)
else
raise "Invalid ping_secret after ping"
end
else
raise "Invalid ping_secret after ping"
end
@@
-41,7
+43,7
@@
class Arvados::V1::NodesController < ApplicationController
if !current_user.andand.is_admin && current_user.andand.is_active
# active non-admin users can list nodes that are (or were
# recently) working
if !current_user.andand.is_admin && current_user.andand.is_active
# active non-admin users can list nodes that are (or were
# recently) working
- @objects = model_class.where('last_ping_at >= ?',
Time.now
- 1.hours)
+ @objects = model_class.where('last_ping_at >= ?',
db_current_time
- 1.hours)
end
super
job_uuids = @objects.map { |n| n[:job_uuid] }.compact
end
super
job_uuids = @objects.map { |n| n[:job_uuid] }.compact