Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dmke committed Nov 18, 2024
1 parent 6f688ca commit 7b1dfc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mini_scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion spec/mini_scheduler/manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down

0 comments on commit 7b1dfc1

Please sign in to comment.