lib/wayfarer/gc.rb in wayfarer-0.4.0 vs lib/wayfarer/gc.rb in wayfarer-0.4.1
- old
+ new
@@ -1,19 +1,15 @@
# frozen_string_literal: true
module Wayfarer
GC = Struct.new(:job) do
def run
+ task = job.task
+
return unless task.counter.decrement <= 0
task.barrier.reset!
task.counter.reset!
- job.class.run_after_batch_callbacks
- end
-
- private
-
- def task
- job.arguments.first
+ job.run_callbacks(:batch)
end
end
end