active_record_host_pool 4.0.0 → 4.1.0
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: 1b17ac5ef20d2f62f857a6a4a7d62ff801767e00c1d5e72b0ec05c9c9818c004
|
4
|
+
data.tar.gz: a7a6b9847c9fda19f32c0929f1a99a5362c22193b550b45602d9d8dde7efde27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d9acc6b59e50dcbeea61b75ed8f3428487ce287136c0cc95b314eb871bfff39ff7380abd779e07870d8388d775864e13d4c3b56dd91be3723904a35618c5afa
|
7
|
+
data.tar.gz: 96e926441b4e9c70fe7ffbe2f46d76eb8ab729438fa01e967eabcfe043073c928c18c3984d51cb644d6bbcef99fd6cc0d57e23af671fda2fea4665acfdbe4a94
|
data/Changelog.md
CHANGED
@@ -6,6 +6,11 @@ and as of v1.0.0 this project adheres to [Semantic Versioning](https://semver.or
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [4.1.0]
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
- Remove dependency on `mutex_m`, instead using `Thread::Mutex` directly.
|
13
|
+
|
9
14
|
## [4.0.0]
|
10
15
|
|
11
16
|
### Changed
|
@@ -23,7 +28,7 @@ and as of v1.0.0 this project adheres to [Semantic Versioning](https://semver.or
|
|
23
28
|
## [3.1.1]
|
24
29
|
|
25
30
|
### Fixed
|
26
|
-
- A typo causing `#clean!` to not run.
|
31
|
+
- A typo causing `#clean!` to not run.
|
27
32
|
|
28
33
|
## [3.1.0]
|
29
34
|
|
@@ -8,7 +8,7 @@ when :trilogy
|
|
8
8
|
when "6.1", "7.0"
|
9
9
|
require "trilogy_adapter/connection"
|
10
10
|
ActiveRecord::Base.extend(TrilogyAdapter::Connection)
|
11
|
-
when "7.1", "7.2", "8.0"
|
11
|
+
when "7.1", "7.2", "8.0", "8.1"
|
12
12
|
require "active_record/connection_adapters/trilogy_adapter"
|
13
13
|
else
|
14
14
|
raise "Unsupported version of Rails (v#{ActiveRecord::VERSION::STRING})"
|
@@ -3,7 +3,6 @@
|
|
3
3
|
require "delegate"
|
4
4
|
require "active_record"
|
5
5
|
require "active_record_host_pool/connection_adapter_mixin"
|
6
|
-
require "mutex_m"
|
7
6
|
|
8
7
|
# this module sits in between ConnectionHandler and a bunch of different ConnectionPools (one per host).
|
9
8
|
# when a connection is requested, it goes like:
|
@@ -16,8 +15,6 @@ require "mutex_m"
|
|
16
15
|
module ActiveRecordHostPool
|
17
16
|
# Sits between ConnectionHandler and a bunch of different ConnectionPools (one per host).
|
18
17
|
class PoolProxy < Delegator
|
19
|
-
include Mutex_m
|
20
|
-
|
21
18
|
case ActiveRecordHostPool.loaded_db_adapter
|
22
19
|
when :mysql2
|
23
20
|
RESCUABLE_DB_ERROR = Mysql2::Error
|
@@ -26,9 +23,10 @@ module ActiveRecordHostPool
|
|
26
23
|
end
|
27
24
|
|
28
25
|
def initialize(pool_config)
|
29
|
-
super
|
26
|
+
super
|
30
27
|
@pool_config = pool_config
|
31
28
|
@config = pool_config.db_config.configuration_hash
|
29
|
+
@mutex = Mutex.new
|
32
30
|
end
|
33
31
|
|
34
32
|
def __getobj__
|
@@ -133,7 +131,7 @@ module ActiveRecordHostPool
|
|
133
131
|
p = _connection_pool(false)
|
134
132
|
return unless p
|
135
133
|
|
136
|
-
synchronize do
|
134
|
+
@mutex.synchronize do
|
137
135
|
p.disconnect!
|
138
136
|
p.automatic_reconnect = true
|
139
137
|
_clear_connection_proxy_cache
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_host_pool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Quorning
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-09
|
14
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activerecord
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
|
-
rubygems_version: 3.5.
|
69
|
+
rubygems_version: 3.5.22
|
70
70
|
signing_key:
|
71
71
|
specification_version: 4
|
72
72
|
summary: Allow ActiveRecord to share a connection to multiple databases on the same
|