@@ -35,28 +35,24 @@ def should_work_on_queue? queuename
35
35
# for five hours now. If you hate this, you can fix it.
36
36
#
37
37
if Resque . size ( "python" ) > 2
38
+ # $stderr.puts "not working on queue, python queue too big. (I have #{queues.size} queues)"
38
39
return false
39
40
end
40
41
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 )
51
45
end
52
46
53
47
# if any of our queues are wildcarded, then we want to round robin among them
54
48
def should_round_robin?
49
+ # $stderr.puts "srr, @srr = #{@srr} queues=#{queues} @queues=#{@queues}"
55
50
return @srr unless @srr . nil?
56
- @srr = @queues . include? '*'
51
+ @srr = @queues [ 0 ] . include? '*'
57
52
end
58
53
59
54
def reserve_with_round_robin
55
+
60
56
if not should_round_robin?
61
57
return reserve_without_round_robin
62
58
end
0 commit comments