mysql2-aurora 0.5.1 → 0.5.2
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 +4 -4
- data/lib/mysql2/aurora.rb +6 -5
- data/lib/mysql2/aurora/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20c07c2b183fc0a6b4576979b2ed2dfede081c31d339eda96a2de08e4021792e
|
4
|
+
data.tar.gz: 9e8bf08dfd718879475f0193f00ad93c7de8e85e6769c1fa3a542f3b061e72c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb8d451e111091e707459e5b97a96aad179d1574db359ca91df13272aa4b5d9859e165155176324c8f18b1649e336910d84b64a8064d0f5bd0b165003ba6a0a4
|
7
|
+
data.tar.gz: 72c9f4eef02e172a74217f96c4561a6bc82a4d3f055e1dbb6a6b8369bae5beb1a2ce9ac7fbe610c9c9024d206b56083b7bad1dde3704d963644053736f947564
|
data/lib/mysql2/aurora.rb
CHANGED
@@ -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
|
-
|
36
|
-
|
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
|
-
|
66
|
+
client.public_send(name, *args, &block)
|
66
67
|
end
|
67
68
|
|
68
69
|
# Delegate method call to Mysql2::Client.
|