Put the size check in the queue
This commit is contained in:
parent
5b2a724219
commit
540ee79ad9
@ -190,6 +190,9 @@ class Queue(object):
|
|||||||
return [message for message in self._messages if message.visible and not message.delayed]
|
return [message for message in self._messages if message.visible and not message.delayed]
|
||||||
|
|
||||||
def add_message(self, message):
|
def add_message(self, message):
|
||||||
|
if len(message) > self.maximum_message_size:
|
||||||
|
raise InvalidParameterValue()
|
||||||
|
|
||||||
self._messages.append(message)
|
self._messages.append(message)
|
||||||
|
|
||||||
def get_cfn_attribute(self, attribute_name):
|
def get_cfn_attribute(self, attribute_name):
|
||||||
@ -252,9 +255,6 @@ class SQSBackend(BaseBackend):
|
|||||||
else:
|
else:
|
||||||
delay_seconds = queue.delay_seconds
|
delay_seconds = queue.delay_seconds
|
||||||
|
|
||||||
if len(message_body) > self.maximum_message_size:
|
|
||||||
raise InvalidParameterValue
|
|
||||||
|
|
||||||
message_id = get_random_message_id()
|
message_id = get_random_message_id()
|
||||||
message = Message(message_id, message_body)
|
message = Message(message_id, message_body)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user