waz-storage 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/waz/queues/queue.rb +1 -1
- data/lib/waz/queues/service.rb +1 -1
- data/waz-storage.gemspec +1 -1
- metadata +1 -1
data/lib/waz/queues/queue.rb
CHANGED
@@ -135,7 +135,7 @@ module WAZ
|
|
135
135
|
def lock(num_of_messages = 1, visibility_timeout = nil)
|
136
136
|
options = {}
|
137
137
|
options[:num_of_messages] = num_of_messages
|
138
|
-
options[:
|
138
|
+
options[:visibility_timeout] = visibility_timeout unless visibility_timeout.nil?
|
139
139
|
messages = self.class.service_instance.get_messages(self.name, options).map do |raw_message|
|
140
140
|
WAZ::Queues::Message.new(raw_message.merge(:queue_name => self.name))
|
141
141
|
end
|
data/lib/waz/queues/service.rb
CHANGED
@@ -65,7 +65,7 @@ module WAZ
|
|
65
65
|
# :visibility_timeout option specifies the timeout of the message locking in seconds (max two hours)
|
66
66
|
def get_messages(queue_name, options = {})
|
67
67
|
raise WAZ::Queues::OptionOutOfRange, {:name => :num_of_messages, :min => 1, :max => 32} if (options.keys.include?(:num_of_messages) && (options[:num_of_messages].to_i < 1 || options[:num_of_messages].to_i > 32))
|
68
|
-
raise WAZ::Queues::OptionOutOfRange, {:name => :visibility_timeout, :min => 1, :max =>
|
68
|
+
raise WAZ::Queues::OptionOutOfRange, {:name => :visibility_timeout, :min => 1, :max => 604800} if (options.keys.include?(:visibility_timeout) && (options[:visibility_timeout].to_i < 1 || options[:visibility_timeout].to_i > 604800))
|
69
69
|
content = execute(:get, "#{queue_name}/messages", options, {:x_ms_version => "2011-08-18"})
|
70
70
|
doc = REXML::Document.new(content)
|
71
71
|
messages = []
|
data/waz-storage.gemspec
CHANGED