coney_island 0.7.11 → 0.7.12
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 +7 -2
- data/test/dummy/log/test.log +4 -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: 35249aa1fc86cd520eb3128ebc8b4f5b581536bc
|
|
4
|
+
data.tar.gz: fb1f5b1f66a2628d7138bf0961f938de78b7c4cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3604103b90ab2b082539deb8103c48f58bd8be236ee7fce57670ad438f6bc0fab158dde85eff0f103e3537b759027dd2d999924b8b426b7ea0569c46a90d9c4
|
|
7
|
+
data.tar.gz: c3df98682ca6a4109043c2e915437728a747d2ef9b4b94adc94c4a9117695bdded489bda9c9d00d3e62fd4351daaf1b7998aab90de89a2b2ac1d2c54f71628fb
|
data/lib/coney_island/version.rb
CHANGED
data/lib/coney_island/worker.rb
CHANGED
|
@@ -101,6 +101,12 @@ module ConeyIsland
|
|
|
101
101
|
self.log.info("Connected to AMQP broker. Running #{AMQP::VERSION}")
|
|
102
102
|
@channel = AMQP::Channel.new(connection)
|
|
103
103
|
@exchange = @channel.topic('coney_island')
|
|
104
|
+
#Handle a lost connection to rabbitMQ
|
|
105
|
+
connection.on_tcp_connection_loss do |connection, settings|
|
|
106
|
+
# since we lost the connection, rabbitMQ will resend all jobs we didn't finish
|
|
107
|
+
# so drop them and restart
|
|
108
|
+
self.abandon_and_shutdown
|
|
109
|
+
end
|
|
104
110
|
|
|
105
111
|
#send a heartbeat every 15 seconds to avoid aggresive network configurations that close quiet connections
|
|
106
112
|
heartbeat_exchange = self.channel.fanout('coney_island_heartbeat')
|
|
@@ -228,11 +234,10 @@ module ConeyIsland
|
|
|
228
234
|
end
|
|
229
235
|
|
|
230
236
|
def self.shutdown(signal)
|
|
231
|
-
shutdown_time = Time.now
|
|
232
237
|
@child_pids.each do |child_pid|
|
|
233
238
|
Process.kill(signal, child_pid)
|
|
234
239
|
end
|
|
235
|
-
@queue.unsubscribe
|
|
240
|
+
@queue.unsubscribe rescue nil
|
|
236
241
|
EventMachine.add_periodic_timer(1) do
|
|
237
242
|
if self.job_attempts.any?
|
|
238
243
|
self.log.info("Waiting for #{self.job_attempts.length} requests to finish")
|
data/test/dummy/log/test.log
CHANGED
|
@@ -12,3 +12,7 @@ Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
|
|
12
12
|
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
|
13
13
|
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
|
14
14
|
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
|
15
|
+
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
|
16
|
+
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
|
17
|
+
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
|
18
|
+
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
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: 0.7.
|
|
4
|
+
version: 0.7.12
|
|
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-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|