mysql_framework 2.1.0 → 2.1.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: f48c69762d95976838c6779c9acfc6591e2113d9a91128f69a2621890332bee0
4
- data.tar.gz: 5d9d0250828d1e93626010796f79364d2f23b22554c38f4bda313ca718faffc6
3
+ metadata.gz: 76573ef7ddc9a996d4bc02f28fad318ca94692eab6df1f7f592229d67f5df3ab
4
+ data.tar.gz: fcbf52818c3cf42d451b15d95fe9609a467ff78402ce31cd43cfae74b5d89b9f
5
5
  SHA512:
6
- metadata.gz: 0e477a4a454360a80a979421aad3ba7db1b7399656062dc7cd129174af1f48953fb3c56d2ad2d959fafbf009a7c1e9f9aa57d34c91c5a06aeb853d0f0e518fb8
7
- data.tar.gz: 2c0980c6a0c94718d0df07d56ae1f88367ce8716d5af457b1c9c6526c29878380bbaeaffaca314dcdf4943d1366c27940675d693fdec4fe961fc183e7a6bb3ed
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.close unless connection_pool_enabled?
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MysqlFramework
4
- VERSION = '2.1.0'
4
+ VERSION = '2.1.1'
5
5
  end
@@ -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.0
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: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake