lib/chaotic_job/scenario.rb in chaotic_job-0.1.0 vs lib/chaotic_job/scenario.rb in chaotic_job-0.1.1
- old
+ new
@@ -14,18 +14,18 @@
@capture = capture
@glitch = nil
@events = []
end
- def run
+ def run(&block)
@job.class.retry_on RetryableError, attempts: 10, wait: 1, jitter: 0
ActiveSupport::Notifications.subscribed(->(event) { @events << event.dup }, @capture) do
glitch.inject! do
- if block_given?
- yield
+ @job.enqueue
+ if block
+ block.call
else
- @job.enqueue
Performer.perform_all
end
end
end