Skip to content

Commit

Permalink
Eliminate lease_connection call in Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Mar 19, 2024
1 parent 5bc1724 commit f8d8183
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion activerecord/lib/active_record/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def collection_cache_key(collection = all, timestamp_column = :updated_at) # :no
def can_use_fast_cache_version?(timestamp)
timestamp.is_a?(String) &&
cache_timestamp_format == :usec &&
self.class.lease_connection.default_timezone == :utc &&
# FIXME: checking out a connection for this is wasteful
# we should store/cache this information in the schema cache
# or similar.
self.class.with_connection(&:default_timezone) == :utc &&
!updated_at_came_from_user?
end

Expand Down

0 comments on commit f8d8183

Please sign in to comment.