mysql2-aurora 0.5.1 → 0.5.2

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: 972a962b2b6b5800dec782880b976e7ea1ef879f089f968918d1bd079392fbd0
4
- data.tar.gz: b1350ad7adfca369fa7188b08d9ba59dd95a04a76a5675602d8f53f038f607e0
3
+ metadata.gz: 20c07c2b183fc0a6b4576979b2ed2dfede081c31d339eda96a2de08e4021792e
4
+ data.tar.gz: 9e8bf08dfd718879475f0193f00ad93c7de8e85e6769c1fa3a542f3b061e72c7
5
5
  SHA512:
6
- metadata.gz: 84cdd45141f51fdbcea71139c91cfb83026675b1f7297be6adc67e0dbcdf98a895575e650c9deb74ce72aa3a65adddbd227f8b245fcce1e6c9d899fc8e7b441e
7
- data.tar.gz: 5fdee14fba2c43e1e6f40fa1404a7d12d4d57a4c782c06f8dbbd5c08f08f948b32fab9e89107553048e6b0084b49aa40630cfd93227405f9a4f10bfddab7b9ef
6
+ metadata.gz: cb8d451e111091e707459e5b97a96aad179d1574db359ca91df13272aa4b5d9859e165155176324c8f18b1649e336910d84b64a8064d0f5bd0b165003ba6a0a4
7
+ data.tar.gz: 72c9f4eef02e172a74217f96c4561a6bc82a4d3f055e1dbb6a6b8369bae5beb1a2ce9ac7fbe610c9c9024d206b56083b7bad1dde3704d963644053736f947564
@@ -7,8 +7,6 @@ module Mysql2
7
7
  module Aurora
8
8
  # Implement client patch
9
9
  class Client
10
- RETRY_INTERVAL_SECONDS = 1.5
11
-
12
10
  attr_reader :client
13
11
 
14
12
  # Initialize class
@@ -32,9 +30,12 @@ module Mysql2
32
30
  try_count += 1
33
31
 
34
32
  if e.message&.include?('--read-only') && try_count <= @max_retry
35
- warn "[mysql2-aurora] Database is readonly. Retry after #{RETRY_INTERVAL_SECONDS}seconds"
36
- sleep RETRY_INTERVAL_SECONDS
33
+ retry_interval_seconds = [1.5 * (try_count - 1), 10].min
34
+
35
+ warn "[mysql2-aurora] Database is readonly. Retry after #{retry_interval_seconds}seconds"
36
+ sleep retry_interval_seconds
37
37
  reconnect!
38
+
38
39
  retry
39
40
  else
40
41
  raise e
@@ -62,7 +63,7 @@ module Mysql2
62
63
  # @param [Array] args Method arguments
63
64
  # @param [Proc] block Method block
64
65
  def method_missing(name, *args, &block) # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
65
- @client.public_send(name, *args, &block)
66
+ client.public_send(name, *args, &block)
66
67
  end
67
68
 
68
69
  # Delegate method call to Mysql2::Client.
@@ -3,6 +3,6 @@ module Mysql2
3
3
  # Major Version: Support `mysql2` major version.
4
4
  # Minor Version: Support `mysql2` minor version.
5
5
  # Tiny Version: Mysql2::Aurora version.
6
- VERSION = '0.5.1'.freeze
6
+ VERSION = '0.5.2'.freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql2-aurora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - alfa-jpn