@@ -35,28 +35,24 @@ def should_work_on_queue? queuename
3535 # for five hours now. If you hate this, you can fix it.
3636 #
3737 if Resque . size ( "python" ) > 2
38+ # $stderr.puts "not working on queue, python queue too big. (I have #{queues.size} queues)"
3839 return false
3940 end
4041
41- return true if @queues . include? '*' # workers with QUEUES=* are special and are not subject to queue depth setting
42- max = DEFAULT_QUEUE_DEPTH
43- unless ENV [ "RESQUE_QUEUE_DEPTH" ] . nil? || ENV [ "RESQUE_QUEUE_DEPTH" ] == ""
44- max = ENV [ "RESQUE_QUEUE_DEPTH" ] . to_i
45- end
46- return true if max == 0 # 0 means no limiting
47- cur_depth = queue_depth ( queuename )
48- log! "queue #{ queuename } depth = #{ cur_depth } max = #{ max } "
49- return true if cur_depth < max
50- false
42+ # $stderr.puts "working on queue, python queue is small. (I have #{queues.size} queues)"
43+
44+ return true if not [ 'replays-low, replays-high' ] . include? ( queuename )
5145 end
5246
5347 # if any of our queues are wildcarded, then we want to round robin among them
5448 def should_round_robin?
49+ # $stderr.puts "srr, @srr = #{@srr} queues=#{queues} @queues=#{@queues}"
5550 return @srr unless @srr . nil?
56- @srr = @queues . include? '*'
51+ @srr = @queues [ 0 ] . include? '*'
5752 end
5853
5954 def reserve_with_round_robin
55+
6056 if not should_round_robin?
6157 return reserve_without_round_robin
6258 end
0 commit comments