[ARVADOS] updated: 27b7b6699084cf091b50f44139232860c5804715
Git user
git at public.curoverse.com
Thu Jul 13 13:41:27 EDT 2017
Summary of changes:
.../api/app/controllers/arvados/v1/container_requests_controller.rb | 5 -----
services/api/app/models/container_request.rb | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
via 27b7b6699084cf091b50f44139232860c5804715 (commit)
from 84b73bac77e316376c4ecfb9aebd1b6c564d77f9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 27b7b6699084cf091b50f44139232860c5804715
Author: radhika <radhika at curoverse.com>
Date: Thu Jul 13 13:33:25 2017 -0400
11682: add before_destroy filter to set priority to zero
Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika at curoverse.com>
diff --git a/services/api/app/controllers/arvados/v1/container_requests_controller.rb b/services/api/app/controllers/arvados/v1/container_requests_controller.rb
index b03fd75..c5da06e 100644
--- a/services/api/app/controllers/arvados/v1/container_requests_controller.rb
+++ b/services/api/app/controllers/arvados/v1/container_requests_controller.rb
@@ -9,9 +9,4 @@ class Arvados::V1::ContainerRequestsController < ApplicationController
accept_attribute_as_json :command, Array
accept_attribute_as_json :filters, Array
accept_attribute_as_json :scheduling_parameters, Hash
-
- def destroy
- @object.update_attributes!(priority: 0) if @object.state != ContainerRequest::Final
- super
- end
end
diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index e8ab0cb..ac40708 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -28,6 +28,7 @@ class ContainerRequest < ArvadosModel
after_save :update_priority
after_save :finalize_if_needed
before_create :set_requesting_container_uuid
+ before_destroy :set_priority_zero
api_accessible :user, extend: :common do |t|
t.add :command
@@ -262,6 +263,10 @@ class ContainerRequest < ArvadosModel
end
end
+ def set_priority_zero
+ self.update_attributes!(priority: 0)
+ end
+
def set_requesting_container_uuid
return !new_record? if self.requesting_container_uuid # already set
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list