Skip to content

Commit

Permalink
Merge pull request #111 from xing/adapt_rails_7_2_changes
Browse files Browse the repository at this point in the history
Use ActiveRecord connection_handler to clear connections
  • Loading branch information
jojahner authored Aug 28, 2024
2 parents 5f9290b + 2dc31dd commit 08c1435
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
ruby-version: [3.1.6, 3.2.5, 3.3.4]
redis-version: [4, 5]
rails-version: [6.1.7.8, 7.0.8.4, 7.1.3.4]
rails-version: [6.1.7.8, 7.0.8.4, 7.1.4, 7.2.1]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
rails_versions = [
"6.1.7.8",
"7.0.8.4",
"7.1.3.4",
"7.2.0"
"7.1.4",
"7.2.1"
]
rails_versions.each do |rails_version|
appraise "redis_4_rails_#{rails_version}" do
Expand Down
4 changes: 2 additions & 2 deletions lib/beetle/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,12 @@ def run_handler(handler)
Timer.timeout(@timeout.to_f) { @handler_result = handler.call(self) }
RC::OK
rescue Exception => @exception
ActiveRecord::Base.clear_all_connections! if defined?(ActiveRecord)
ActiveRecord::Base.connection_handler.clear_all_connections! if defined?(ActiveRecord)
Beetle::reraise_expectation_errors!
logger.debug "Beetle: message handler crashed on #{msg_id}"
RC::HandlerCrash
ensure
ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord)
ActiveRecord::Base.connection_handler.clear_active_connections! if defined?(ActiveRecord)
end

def run_handler!(handler)
Expand Down

0 comments on commit 08c1435

Please sign in to comment.