pg_reconnect 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pg_reconnect/ar3.rb +2 -2
- data/pg_reconnect.gemspec +2 -1
- metadata +69 -39
data/lib/pg_reconnect/ar3.rb
CHANGED
@@ -11,7 +11,7 @@ class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
|
|
11
11
|
rescue ActiveRecord::StatementInvalid => ex
|
12
12
|
unless active?
|
13
13
|
@retry_counter ||= 0
|
14
|
-
|
14
|
+
send(:log, Logger::WARN) { "Reconnecting to database after PGError! Try ##{@retry_counter + 1}/#{MAX_QUERY_RETRIES} #{ex.message}, trace: #{ex.backtrace.inspect}" }
|
15
15
|
|
16
16
|
if @retry_counter < MAX_QUERY_RETRIES
|
17
17
|
@retry_counter += 1
|
@@ -24,4 +24,4 @@ class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
|
|
24
24
|
raise
|
25
25
|
end
|
26
26
|
|
27
|
-
end
|
27
|
+
end
|
data/pg_reconnect.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "pg_reconnect"
|
7
|
-
gem.version = "0.1.
|
7
|
+
gem.version = "0.1.3"
|
8
8
|
gem.authors = ["'Konstantin Makarchev'"]
|
9
9
|
gem.email = ["'kostya27@gmail.com'"]
|
10
10
|
gem.description = %q{ActiveRecord PostgreSQL auto-reconnection, works with 2.3 and 3.2 rails.}
|
@@ -17,4 +17,5 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
|
19
19
|
gem.add_dependency 'activerecord', ">=2"
|
20
|
+
gem.add_development_dependency 'rake'
|
20
21
|
end
|
metadata
CHANGED
@@ -1,39 +1,61 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_reconnect
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
-
|
12
|
+
authors:
|
13
|
+
- "'Konstantin Makarchev'"
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2014-04-17 00:00:00 +04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 7
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
version: "2"
|
32
|
+
requirement: *id001
|
33
|
+
name: activerecord
|
22
34
|
type: :runtime
|
35
|
+
- !ruby/object:Gem::Dependency
|
23
36
|
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
25
38
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
requirement: *id002
|
47
|
+
name: rake
|
48
|
+
type: :development
|
30
49
|
description: ActiveRecord PostgreSQL auto-reconnection, works with 2.3 and 3.2 rails.
|
31
|
-
email:
|
32
|
-
-
|
50
|
+
email:
|
51
|
+
- "'kostya27@gmail.com'"
|
33
52
|
executables: []
|
53
|
+
|
34
54
|
extensions: []
|
55
|
+
|
35
56
|
extra_rdoc_files: []
|
36
|
-
|
57
|
+
|
58
|
+
files:
|
37
59
|
- .gitignore
|
38
60
|
- Gemfile
|
39
61
|
- LICENSE.txt
|
@@ -44,31 +66,39 @@ files:
|
|
44
66
|
- lib/pg_reconnect/ar3.rb
|
45
67
|
- lib/pg_reconnect/ar_extend.rb
|
46
68
|
- pg_reconnect.gemspec
|
47
|
-
|
69
|
+
has_rdoc: true
|
70
|
+
homepage: ""
|
48
71
|
licenses: []
|
72
|
+
|
49
73
|
post_install_message:
|
50
74
|
rdoc_options: []
|
51
|
-
|
75
|
+
|
76
|
+
require_paths:
|
52
77
|
- lib
|
53
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
79
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 3
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
version: "0"
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
88
|
none: false
|
61
|
-
requirements:
|
62
|
-
- -
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
65
96
|
requirements: []
|
97
|
+
|
66
98
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.
|
99
|
+
rubygems_version: 1.4.2
|
68
100
|
signing_key:
|
69
101
|
specification_version: 3
|
70
|
-
summary: ActiveRecord PostgreSQL auto-reconnection, works with 2.3 and 3.2 rails.
|
71
|
-
Uses hackety wrapper on adapter execute. Ideal for using with pgbouncer and large
|
72
|
-
number of almost idle connections (in threads).
|
102
|
+
summary: ActiveRecord PostgreSQL auto-reconnection, works with 2.3 and 3.2 rails. Uses hackety wrapper on adapter execute. Ideal for using with pgbouncer and large number of almost idle connections (in threads).
|
73
103
|
test_files: []
|
74
|
-
|
104
|
+
|