active_record_proxy_adapters 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8af46e249283bd304b76cd6f92c4ebd8547078c29529e63a39c04c90ace297d2
|
|
4
|
+
data.tar.gz: c3753aaf59899dd7f97b288b4ead7f478a9341a32afba0e4603125e860956ad9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34eebec75d208cf8cc8226382dfe26b7e63e88e0e5c4ebbc802259875c0972b51346aabdf92c82ef912bcef92ba06933a54ccfa30060e31d69d2791e8bcb4fa6
|
|
7
|
+
data.tar.gz: e07490e7946807c07d626c43932ea1996349048ee953a1a407d7048c382446eb984530db358ff916d8c46f5548828a8325271399b92b4ac9a4db7ea563bae287
|
|
@@ -173,15 +173,6 @@ module ActiveRecordProxyAdapters
|
|
|
173
173
|
update_primary_latest_write_timestamp if !replica_connection?(connection) && write_statement?(sql_string)
|
|
174
174
|
|
|
175
175
|
result
|
|
176
|
-
ensure
|
|
177
|
-
# Check the connection back into its own pool, not whatever pool currently
|
|
178
|
-
# answers to the :reading role. In Rails system tests,
|
|
179
|
-
# ActiveRecord::TestFixtures#setup_shared_connection_pool reassigns the
|
|
180
|
-
# :reading role's pool_config on every transactional-fixture test's
|
|
181
|
-
# before_setup, so re-resolving `replica_pool` here can return a pool
|
|
182
|
-
# different from the one the connection was checked out of — which would
|
|
183
|
-
# check a replica adapter into the primary pool and poison it.
|
|
184
|
-
connection.pool.checkin(connection) if replica_connection?(connection)
|
|
185
176
|
end
|
|
186
177
|
|
|
187
178
|
def connected_to(role:, &block)
|
|
@@ -195,7 +186,7 @@ module ActiveRecordProxyAdapters
|
|
|
195
186
|
end
|
|
196
187
|
|
|
197
188
|
def checkout_replica_connection
|
|
198
|
-
replica_pool.
|
|
189
|
+
replica_pool.lease_connection
|
|
199
190
|
# rescue NoDatabaseError to avoid crashing when running db:create rake task
|
|
200
191
|
# rescue ConnectionNotEstablished to handle connectivity issues in the replica
|
|
201
192
|
# (for example, replication delay)
|