sneakers 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aeb60ce69dfdcd3827ba365bc9e7a2b57ea4e6b7
4
- data.tar.gz: 5dfc47a8211dd79822bb3fe8c4ec61f51a5b6d92
3
+ metadata.gz: 733fe6cd472f61a3055431c5d17d1ca8ff14690a
4
+ data.tar.gz: 523562a5e31f948814c2384a91151a2cd2df7a0d
5
5
  SHA512:
6
- metadata.gz: 36c682fb4bca53a96ea72016677c617245be8092dea6c48d612bffed0b3c2b37c4be9db6fb238b0358998b01eca64580f8706e6dd59d20a7ff4841482a825c3b
7
- data.tar.gz: 5d3431dd0cb6b027f578c5679b2c11b175e1fc8a0caede9c37de1dcce05fbe4b417c85844da990f993d33a42f8300f1c30008ecdd44124a3af897ddf8ae31fe8
6
+ metadata.gz: 07fbd52feddac85c3e29d6435b139d9e89d2853694e623dabe36a330dfbd082a2e219d3ce906d21038f1af37891d92012b95f7a0e6bc8fc30e9a88c5650babae
7
+ data.tar.gz: ca949d95e442ef2b6f89f9c4506eceeaade78a5f9bcb1d1700a60419891bd34fe1ec66c8c1283cc7077302a8046cccf5df8580cfea207da22a1e4ea03d572fef
@@ -52,7 +52,7 @@ module Sneakers
52
52
  Sneakers.logger.debug { "#{log_prefix} creating exchange=#{name}" }
53
53
  @channel.exchange(name,
54
54
  :type => 'topic',
55
- :durable => opts[:durable])
55
+ :durable => exchange_durable?)
56
56
  end
57
57
 
58
58
  # Create the queues and bindings
@@ -60,7 +60,7 @@ module Sneakers
60
60
  "#{log_prefix} creating queue=#{retry_name} x-dead-letter-exchange=#{requeue_name}"
61
61
  end
62
62
  @retry_queue = @channel.queue(retry_name,
63
- :durable => opts[:durable],
63
+ :durable => queue_durable?,
64
64
  :arguments => {
65
65
  :'x-dead-letter-exchange' => requeue_name,
66
66
  :'x-message-ttl' => @opts[:retry_timeout] || 60000
@@ -71,7 +71,7 @@ module Sneakers
71
71
  "#{log_prefix} creating queue=#{error_name}"
72
72
  end
73
73
  @error_queue = @channel.queue(error_name,
74
- :durable => opts[:durable])
74
+ :durable => queue_durable?)
75
75
  @error_queue.bind(@error_exchange, :routing_key => '#')
76
76
 
77
77
  # Finally, bind the worker queue to our requeue exchange
@@ -186,6 +186,15 @@ module Sneakers
186
186
  end
187
187
  private :log_prefix
188
188
 
189
+ private
190
+
191
+ def queue_durable?
192
+ @opts.fetch(:queue_options, {}).fetch(:durable, false)
193
+ end
194
+
195
+ def exchange_durable?
196
+ queue_durable?
197
+ end
189
198
  end
190
199
  end
191
200
  end
@@ -1,3 +1,3 @@
1
1
  module Sneakers
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.2"
3
3
  end
@@ -132,7 +132,9 @@ describe 'Handlers' do
132
132
  before(:each) do
133
133
  @opts = {
134
134
  :exchange => 'sneakers',
135
- :durable => 'true',
135
+ :queue_options => {
136
+ :durable => 'true',
137
+ }
136
138
  }.tap do |opts|
137
139
  opts[:retry_max_times] = max_retries unless max_retries.nil?
138
140
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sneakers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dotan Nahum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serverengine