coney_island 0.7.12 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coney_island/version.rb +1 -1
- data/lib/coney_island/worker.rb +5 -2
- 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: c35298c5543296c4c41a42bd756f6ef193a29186
|
4
|
+
data.tar.gz: ef14d5797940fd78f324126b7d86e42c7130ef04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 790d75b9af3c13a51f0493350956c8026d87976efb5f45b2cee87c7c06891a19ac574264ab9aa8e638b162c56f93e693fbd5141e70bb01f7d69b9a5bacd9c3a7
|
7
|
+
data.tar.gz: 7b45b0327ea9fe7f01bf76a509921f80dc3e8b355ad35a49206d8d0df68c08fc8289b7581cefbc766b42e7be364d82654288e5ef6eb551802deaf17a0bcb2fbd
|
data/lib/coney_island/version.rb
CHANGED
data/lib/coney_island/worker.rb
CHANGED
@@ -105,7 +105,9 @@ module ConeyIsland
|
|
105
105
|
connection.on_tcp_connection_loss do |connection, settings|
|
106
106
|
# since we lost the connection, rabbitMQ will resend all jobs we didn't finish
|
107
107
|
# so drop them and restart
|
108
|
-
|
108
|
+
unless @shutting_down
|
109
|
+
self.abandon_and_shutdown
|
110
|
+
end
|
109
111
|
end
|
110
112
|
|
111
113
|
#send a heartbeat every 15 seconds to avoid aggresive network configurations that close quiet connections
|
@@ -228,12 +230,13 @@ module ConeyIsland
|
|
228
230
|
end
|
229
231
|
|
230
232
|
def self.abandon_and_shutdown
|
231
|
-
self.log.info("Lost RabbitMQ connection, abandoning current jobs and
|
233
|
+
self.log.info("Lost RabbitMQ connection, abandoning current jobs and shutting down")
|
232
234
|
self.clear_job_attempts
|
233
235
|
self.shutdown('TERM')
|
234
236
|
end
|
235
237
|
|
236
238
|
def self.shutdown(signal)
|
239
|
+
@shutting_down = true
|
237
240
|
@child_pids.each do |child_pid|
|
238
241
|
Process.kill(signal, child_pid)
|
239
242
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -16,3 +16,5 @@ ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
|
16
16
|
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
17
17
|
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
18
18
|
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
19
|
+
ConeyIsland::Submitter.submit! about to iterate over this many jobs: 1
|
20
|
+
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: 0.
|
4
|
+
version: '0.8'
|
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-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|