filecluster 0.5.5 → 0.5.6
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/fc/db.rb +4 -2
- data/lib/fc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64e0a0eaa5236b7655114f5bf118901a952e316a
|
4
|
+
data.tar.gz: c243b1d8382c59b1168103fbbdcf8c3be533e439
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0740caba745e485f4d7d029153bad3ef7b54081d87717e6a294bc9d0dbb8e9ea103e04abcc304a51cb4053e87b2dda73d94f61e3bbf4f04cee929c34262699dc
|
7
|
+
data.tar.gz: 42eee976acc2d1f7449f55bb26c25b3b5a045dd2250c819cc9c031fb8dafb9f793a149258113a901923effb463322405ee9fbac6677d62ab7c000d3770dfe5d0
|
data/lib/fc/db.rb
CHANGED
@@ -4,7 +4,7 @@ require 'psych'
|
|
4
4
|
module FC
|
5
5
|
module DB
|
6
6
|
class << self
|
7
|
-
attr_accessor :options, :prefix, :err_counter, :no_active_record, :connect_block, :logger
|
7
|
+
attr_accessor :options, :prefix, :err_counter, :no_active_record, :connect_block, :logger, :reconnecting
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.options_yml_path
|
@@ -19,6 +19,7 @@ module FC
|
|
19
19
|
@options = symbolize_keys(options)
|
20
20
|
@prefix = @options[:prefix].to_s if @options[:prefix]
|
21
21
|
connection = Mysql2::Client.new(@options)
|
22
|
+
@reconnecting = false
|
22
23
|
@connect_block = nil
|
23
24
|
@connects = {} unless @connects
|
24
25
|
@connects[Thread.current.object_id] = connection
|
@@ -59,7 +60,7 @@ module FC
|
|
59
60
|
def self.connect
|
60
61
|
connect_by_block if @connect_block
|
61
62
|
return nil unless @options
|
62
|
-
connect_by_config(@options) if @options[:multi_threads] && !@connects[Thread.current.object_id]
|
63
|
+
connect_by_config(@options) if @reconnecting || @options[:multi_threads] && !@connects[Thread.current.object_id]
|
63
64
|
if @options[:multi_threads]
|
64
65
|
@connects[Thread.current.object_id]
|
65
66
|
else
|
@@ -84,6 +85,7 @@ module FC
|
|
84
85
|
|
85
86
|
def self.reconnect
|
86
87
|
close if connect
|
88
|
+
@reconnecting = true
|
87
89
|
connect_by_config(@options)
|
88
90
|
end
|
89
91
|
|
data/lib/fc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filecluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|