lib/ci/queue/static.rb in ci-queue-0.5.1 vs lib/ci/queue/static.rb in ci-queue-0.5.2
- old
+ new
@@ -28,29 +28,26 @@
def empty?
@queue.empty?
end
- def acknowledge(test, success)
- if !success && should_requeue?(test)
- requeue(test)
- return false
- end
-
+ def acknowledge(test)
true
end
+ def requeue(test)
+ return false unless should_requeue?(test)
+ requeues[test] += 1
+ @queue.unshift(test)
+ true
+ end
+
private
attr_reader :max_requeues, :global_max_requeues
def should_requeue?(test)
requeues[test] < max_requeues && requeues.values.inject(0, :+) < global_max_requeues
- end
-
- def requeue(test)
- requeues[test] += 1
- @queue.unshift(test)
end
def requeues
@requeues ||= Hash.new(0)
end