emissary 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/emissary.rb +9 -8
- data/lib/emissary/agent/mysql.rb +11 -1
- metadata +5 -5
data/VERSION.yml
CHANGED
data/lib/emissary.rb
CHANGED
@@ -17,6 +17,7 @@ require 'rubygems'
|
|
17
17
|
require 'uuid'
|
18
18
|
require 'digest/md5'
|
19
19
|
require 'yaml'
|
20
|
+
require 'pathname'
|
20
21
|
|
21
22
|
begin
|
22
23
|
require 'thread'
|
@@ -26,14 +27,14 @@ end
|
|
26
27
|
|
27
28
|
module Emissary
|
28
29
|
# :stopdoc:
|
29
|
-
LIBPATH =
|
30
|
-
PATH
|
31
|
-
VERSION = ::YAML.load(
|
30
|
+
LIBPATH = Pathname.new(__FILE__).dirname.realpath
|
31
|
+
PATH = LIBPATH.dirname
|
32
|
+
VERSION = ::YAML.load(PATH + 'VERSION.yml')).values.join '.'
|
32
33
|
|
33
|
-
EXTERNALS_BASE =
|
34
|
-
EXTERNAL_IDENTITIES =
|
35
|
-
EXTERNAL_AGENTS =
|
36
|
-
EXTERNAL_OPERATORS =
|
34
|
+
EXTERNALS_BASE = Pathname.new('/opt/emissary')
|
35
|
+
EXTERNAL_IDENTITIES = EXTERNALS_BASE + 'identities'
|
36
|
+
EXTERNAL_AGENTS = EXTERNALS_BASE + 'agents'
|
37
|
+
EXTERNAL_OPERATORS = EXTERNALS_BASE + 'operators'
|
37
38
|
|
38
39
|
DEFAULT_EXCHANGE = :direct
|
39
40
|
DAEMON_RECHECK_INTERVAL = 10
|
@@ -58,7 +59,7 @@ module Emissary
|
|
58
59
|
# <tt>File.join</tt>.
|
59
60
|
#
|
60
61
|
def libpath( *args )
|
61
|
-
|
62
|
+
LIBPATH.join(args.flatten)
|
62
63
|
end
|
63
64
|
|
64
65
|
# Returns the path for the module. If any arguments are given,
|
data/lib/emissary/agent/mysql.rb
CHANGED
@@ -116,6 +116,16 @@ module Emissary
|
|
116
116
|
|
117
117
|
|
118
118
|
def connection
|
119
|
+
begin
|
120
|
+
@connection.ping() unless @connection.nil?
|
121
|
+
rescue ::Mysql::Error => e
|
122
|
+
if e.message =~ /server has gone away/
|
123
|
+
@connection = nil
|
124
|
+
else
|
125
|
+
raise e
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
119
129
|
@connection ||= ::Mysql.real_connect(@host, @user, @password)
|
120
130
|
end
|
121
131
|
|
@@ -165,8 +175,8 @@ module Emissary
|
|
165
175
|
}
|
166
176
|
end
|
167
177
|
ensure
|
168
|
-
kill_watcher_thread!
|
169
178
|
disconnect
|
179
|
+
kill_watcher_thread!
|
170
180
|
end
|
171
181
|
end
|
172
182
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emissary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 9
|
10
|
+
version: 1.3.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Carl P. Corliss
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-15 00:00:00 -04:00
|
19
19
|
default_executable: bin/emissary-setup
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -228,7 +228,7 @@ files:
|
|
228
228
|
- VERSION.yml
|
229
229
|
- LICENSE
|
230
230
|
- README.txt
|
231
|
-
has_rdoc:
|
231
|
+
has_rdoc: false
|
232
232
|
homepage: http://www.nytimes.com/
|
233
233
|
licenses: []
|
234
234
|
|