mysql_framework 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76573ef7ddc9a996d4bc02f28fad318ca94692eab6df1f7f592229d67f5df3ab
|
4
|
+
data.tar.gz: fcbf52818c3cf42d451b15d95fe9609a467ff78402ce31cd43cfae74b5d89b9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a8011fafcfaab143dc3e74ddd4d00b5f256ef8051e4139df564e96959a79d9b6f8128704303d93e803c7fe8e4482757105152bfc1a60ad8628c2706155e5169
|
7
|
+
data.tar.gz: a08b82318c591fe884d5276e1eb1447a8a3460b2f3901a74b29b90a4bafaa44e483bedaf5908696f28756fd265b49c80fe7841316df2826fff0f18363763c6dd
|
@@ -59,10 +59,9 @@ module MysqlFramework
|
|
59
59
|
|
60
60
|
# This method is called to check a client back in to the connection when no longer needed.
|
61
61
|
def check_in(client)
|
62
|
-
return client
|
63
|
-
|
64
|
-
client = new_client if client.closed?
|
62
|
+
return client&.close unless connection_pool_enabled?
|
65
63
|
|
64
|
+
client = new_client if client.nil? || client.closed?
|
66
65
|
@connection_pool.push(client)
|
67
66
|
end
|
68
67
|
|
@@ -232,6 +232,24 @@ describe MysqlFramework::Connector do
|
|
232
232
|
subject.check_in(client)
|
233
233
|
end
|
234
234
|
end
|
235
|
+
|
236
|
+
context 'when client is nil' do
|
237
|
+
let(:client) { nil }
|
238
|
+
|
239
|
+
context 'when connection pooling is enabled' do
|
240
|
+
it 'does not raise an error' do
|
241
|
+
expect { subject.check_in(client) }.not_to raise_error
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
context 'when connection pooling is disabled' do
|
246
|
+
let(:connection_pooling_enabled) { 'false' }
|
247
|
+
|
248
|
+
it 'does not raise an error' do
|
249
|
+
expect { subject.check_in(client) }.not_to raise_error
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
235
253
|
end
|
236
254
|
|
237
255
|
describe '#with_client' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sage
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|