lib/right_chimp/queue/ChimpQueue.rb in right_chimp-1.0.9 vs lib/right_chimp/queue/ChimpQueue.rb in right_chimp-1.1.0
- old
+ new
@@ -46,10 +46,17 @@
#
# Push a task into the queue
#
def push(g, w)
+ if w.exec.right_script && w.exec.right_script.kind_of?(Hash)
+ Log.debug "Pushing job '#{w.exec.right_script['name']}' into group '#{g}'"
+ if w.status == Executor::STATUS_HOLDING
+ Log.info "Holding job '#{w.exec.right_script['name']}'"
+ end
+ end
+
raise "no group specified" unless g
create_group(g) if not ChimpQueue[g]
ChimpQueue[g].push(w)
end
@@ -68,9 +75,10 @@
r = nil
@semaphore.synchronize do
@group.values.each do |group|
if group.ready?
r = group.shift
+ Log.debug "Shifting job '#{r.job_id}' from group '#{group.group_id}'"
break
end
end
end
return(r)