diff --git a/lib/mini_scheduler.rb b/lib/mini_scheduler.rb index e6bea57..f0f9e87 100644 --- a/lib/mini_scheduler.rb +++ b/lib/mini_scheduler.rb @@ -22,7 +22,7 @@ def self.job_exception_handler(&blk) @job_exception_handler end - def self.handle_job_exception(ex, context = {}) + def self.handle_job_exception(ex, context = {}, _component = nil) if job_exception_handler job_exception_handler.call(ex, context) else diff --git a/spec/mini_scheduler/manager_spec.rb b/spec/mini_scheduler/manager_spec.rb index 821c848..454e78a 100644 --- a/spec/mini_scheduler/manager_spec.rb +++ b/spec/mini_scheduler/manager_spec.rb @@ -438,7 +438,11 @@ def call(ex, ctx, _component) end context "with custom handler" do - before { MiniScheduler.job_exception_handler { |ex, ctx| expect_job_failure(ex, ctx) } } + before do + MiniScheduler.job_exception_handler do |ex, ctx, _component = nil| + expect_job_failure(ex, ctx) + end + end after { MiniScheduler.instance_variable_set :@job_exception_handler, nil }