leecher 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,8 +50,6 @@ module Leecher
50
50
 
51
51
 
52
52
  def run()
53
- @bunny = make_bunny(self.bunny_opts)
54
-
55
53
  @graceful_shutdown = false
56
54
  @dont_kill_me = false
57
55
  [:INT, :TERM].each do |sig|
@@ -71,7 +69,8 @@ module Leecher
71
69
 
72
70
  until @graceful_shutdown
73
71
  begin
74
- q = get_queue(@bunny, username, metalink_queue_name)
72
+ b = make_bunny(self.bunny_opts)
73
+ q = get_queue(b, username, metalink_queue_name)
75
74
  drain_metalink_queue(q)
76
75
  rescue ShutdownError => e
77
76
  log.info(["Going away because of", e.message].join(": "))
@@ -83,17 +82,11 @@ module Leecher
83
82
  end
84
83
 
85
84
  # Silently try throw away our existing bunny.
86
- if @bunny.status == :connected
87
- @bunny.stop() rescue Exception
85
+ if b && b.status == :connected
86
+ b.stop() rescue Exception
88
87
  end
89
88
 
90
- log.debug("We've shot the old bunny - we'll make a new one in "\
91
- "a few seconds.")
92
- Kernel.sleep(3)
93
-
94
- # Start again.
95
- log.debug("Reconnecting to rabbitmq")
96
- @bunny = make_bunny(self.bunny_opts)
89
+ log.debug("Will reconnect after 3s")
97
90
  rescue Exception => e
98
91
  log.error([e.class.name, e.message].join(": "))
99
92
  e.backtrace.each do |line|
@@ -1,3 +1,3 @@
1
1
  module Leecher
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leecher
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marc Bowes
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-26 00:00:00 +02:00
18
+ date: 2011-05-30 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency