Skip to content

Commit

Permalink
Improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgi committed Jun 27, 2024
1 parent f24adb2 commit ea71a07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/que/active_record/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def clear_active_connections_if_needed!(job)
# see https://github.com/que-rb/que/pull/393
return if job.class.resolve_que_setting(:run_synchronously)

# don't clear connections in nested jobs,
# i.e. clear only if this is the outermost instance of
# Que::ActiveRecord::Connection::JobMiddleware
# don't clear connections in nested jobs executed synchronously
# i.e. while we're still inside of the rails executor
# see https://github.com/que-rb/que/pull/412#issuecomment-2194412783
return if Que::ActiveRecord.active_rails_executor?

::ActiveRecord::Base.clear_active_connections!
Expand Down

0 comments on commit ea71a07

Please sign in to comment.