fresh_connection 0.4.1 → 0.4.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/fresh_connection/connection_manager.rb +8 -1
- data/lib/fresh_connection/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f7219fe266291b57df16e6ff52d4c11aed5c0904
|
|
4
|
+
data.tar.gz: 59af852fd4ae575f7f6cb1fd5bdbaa49e823d16d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0ed4657a4f37ad1821508d78f74e963331ea807d35a58e868392731296d214567c1cf82a295c8cb66ff40532262b7afc12b5cbe7dacee204817038597b7db92
|
|
7
|
+
data.tar.gz: 6ace3cbb2659fae15bedf325045490e728fa64809ef85695fe130cf394c0d28bd4fa2eaa28f34125a8343f2e0dd4919fadcde5c4627940aaf2790e62e9cd6645
|
|
@@ -10,12 +10,19 @@ module FreshConnection
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def put_aside!
|
|
13
|
+
synchronize do
|
|
14
|
+
if c = slave_connections.delete(current_thread_id)
|
|
15
|
+
c.disconnect! rescue nil
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def clear_all_connections!
|
|
13
21
|
synchronize do
|
|
14
22
|
slave_connections.values.each {|c| c.disconnect! rescue nil }
|
|
15
23
|
@slave_connections.clear
|
|
16
24
|
end
|
|
17
25
|
end
|
|
18
|
-
alias_method :clear_all_connections!, :put_aside!
|
|
19
26
|
|
|
20
27
|
def recovery(failure_connection, exception)
|
|
21
28
|
do_recovery = slave_down_message?(exception.message)
|