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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fc/db.rb +4 -2
  3. data/lib/fc/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09926dfab03ca82fe41a029a554098bd80e7d596
4
- data.tar.gz: 584db18e46de8e00dede1833ab4b206d02774d3d
3
+ metadata.gz: 64e0a0eaa5236b7655114f5bf118901a952e316a
4
+ data.tar.gz: c243b1d8382c59b1168103fbbdcf8c3be533e439
5
5
  SHA512:
6
- metadata.gz: 1d7a502bcd878cb1847fb7c168fbfc8239d0e1a3050b6938b86b1311fada3e2595d16004bee2025166e086f90b9bb61dd77c8c8c3f1113cbceb0b6aa89ddf0d2
7
- data.tar.gz: e863eb81db7bde65539315d19f14585d54f083f66524a25051e1c7f0205728fb8aec346824e14cc503453ff5b219c0da167d68e95fe2f70774b8fbeafc2f7d20
6
+ metadata.gz: 0740caba745e485f4d7d029153bad3ef7b54081d87717e6a294bc9d0dbb8e9ea103e04abcc304a51cb4053e87b2dda73d94f61e3bbf4f04cee929c34262699dc
7
+ data.tar.gz: 42eee976acc2d1f7449f55bb26c25b3b5a045dd2250c819cc9c031fb8dafb9f793a149258113a901923effb463322405ee9fbac6677d62ab7c000d3770dfe5d0
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module FC
2
- VERSION = '0.5.5'.freeze
2
+ VERSION = '0.5.6'.freeze
3
3
  end
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.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-02-20 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2