coney_island 0.7 → 0.7.1
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/coney_island/version.rb +1 -1
- data/lib/coney_island/worker.rb +24 -24
- data/test/dummy/log/test.log +2 -0
- 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: 7d3235b3a4ba3ab30ab945fe646f984e590fadc3
|
|
4
|
+
data.tar.gz: 0c246415fb168c1bfa4f7164c9d351cd1fa71a75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bdff43883e7dad6eed7488bef99997eecd2c4414518790bfe8c0db483ad4e5a489fada58167e07d7155a28501cf75e10ef8ae05dea5e013c698d3cb147281049
|
|
7
|
+
data.tar.gz: c3afba951a9fc3eeedf21a6239421db1c88847f934572720fef74391fe01b4dcc63a6e2249df9ea6fdbc92df8f76cc426d232eb19015eabd4905b4dc58c8c59e
|
data/lib/coney_island/version.rb
CHANGED
data/lib/coney_island/worker.rb
CHANGED
|
@@ -78,16 +78,16 @@ module ConeyIsland
|
|
|
78
78
|
defined?(ActiveRecord::Base) and
|
|
79
79
|
ActiveRecord::Base.establish_connection
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
begin
|
|
82
|
+
EventMachine.run do
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
Signal.trap('INT') do
|
|
85
|
+
self.shutdown('INT')
|
|
86
|
+
end
|
|
87
|
+
Signal.trap('TERM') do
|
|
88
|
+
self.shutdown('TERM')
|
|
89
|
+
end
|
|
89
90
|
|
|
90
|
-
begin
|
|
91
91
|
AMQP.connect(self.amqp_parameters) do |connection|
|
|
92
92
|
self.log.info("Connected to AMQP broker. Running #{AMQP::VERSION}")
|
|
93
93
|
@channel = AMQP::Channel.new(connection)
|
|
@@ -106,22 +106,22 @@ module ConeyIsland
|
|
|
106
106
|
self.handle_incoming_message(metadata,payload)
|
|
107
107
|
end
|
|
108
108
|
end
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
109
|
+
end
|
|
110
|
+
rescue AMQP::TCPConnectionFailed => e
|
|
111
|
+
ConeyIsland.tcp_connection_retries ||= 0
|
|
112
|
+
ConeyIsland.tcp_connection_retries += 1
|
|
113
|
+
if ConeyIsland.tcp_connection_retries >= ConeyIsland.tcp_connection_retry_limit
|
|
114
|
+
message = "Failed to connect to RabbitMQ #{ConeyIsland.tcp_connection_retry_limit} times, bailing out"
|
|
115
|
+
self.log.error(message)
|
|
116
|
+
ConeyIsland.poke_the_badger(e, {
|
|
117
|
+
code_source: 'ConeyIsland::Worker.start',
|
|
118
|
+
reason: message}
|
|
119
|
+
)
|
|
120
|
+
else
|
|
121
|
+
message = "Failed to connecto to RabbitMQ Attempt ##{ConeyIsland.tcp_connection_retries} time(s), trying again in #{ConeyIsland.tcp_connection_retry_interval} seconds..."
|
|
122
|
+
self.log.error(message)
|
|
123
|
+
sleep(10)
|
|
124
|
+
retry
|
|
125
125
|
end
|
|
126
126
|
end
|
|
127
127
|
end
|
data/test/dummy/log/test.log
CHANGED
|
@@ -2,3 +2,5 @@ ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
|
|
2
2
|
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
|
3
3
|
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
|
4
4
|
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
|
5
|
+
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
|
6
|
+
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: coney_island
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Draut
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-01-
|
|
12
|
+
date: 2015-01-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|