[ARVADOS] updated: 33166913f14878fd317b9a07e038f8d294453b94

git at public.curoverse.com git at public.curoverse.com
Fri Mar 21 14:11:50 EDT 2014


Summary of changes:
 services/api/script/crunch-dispatch.rb |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

       via  33166913f14878fd317b9a07e038f8d294453b94 (commit)
      from  24742cd39eff59df5d4ac17d7d39c437c79a456b (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 33166913f14878fd317b9a07e038f8d294453b94
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Mar 21 14:11:36 2014 -0400

    Expiring pipeline tokens works.

diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index 0835e1f..ac1c428 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -39,6 +39,7 @@ class Dispatcher
   def refresh_todo
     @todo = Job.queue
     @todo_pipelines = PipelineInstance.queue
+    @pipe_auth_tokens ||= { }
   end
 
   def sinfo
@@ -324,10 +325,7 @@ class Dispatcher
   end
 
   def update_pipelines
-    @pipe_auth_tokens ||= { }
     expire_tokens = @pipe_auth_tokens.dup
-    puts "1 @pipe_auth_tokens #{@pipe_auth_tokens}"
-    puts "1 expire_tokens #{expire_tokens}"
     @todo_pipelines.each do |p|
       if @pipe_auth_tokens[p.uuid].nil?
         pipe_auth = ApiClientAuthorization.
@@ -341,8 +339,6 @@ class Dispatcher
       expire_tokens.delete p.uuid
     end
 
-    puts "2 @pipe_auth_tokens #{@pipe_auth_tokens}"
-    puts "2 expire_tokens #{expire_tokens}"
     expire_tokens.each do |k, v|
       v.update_attributes expires_at: Time.now
       @pipe_auth_tokens.delete k
@@ -373,7 +369,7 @@ class Dispatcher
         unless @todo.empty? or did_recently(:start_jobs, 1.0) or $signal[:term]
           start_jobs
         end
-        unless @todo_pipelines.empty? or did_recently(:update_pipelines, 5.0)
+        unless (@todo_pipelines.empty? and @pipe_auth_tokens.empty?) or did_recently(:update_pipelines, 5.0)
           update_pipelines
         end
       end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list