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]
|
||||
|
||||
def add_message(self, message):
|
||||
if len(message) > self.maximum_message_size:
|
||||
raise InvalidParameterValue()
|
||||
|
||||
self._messages.append(message)
|
||||
|
||||
def get_cfn_attribute(self, attribute_name):
|
||||
@ -252,9 +255,6 @@ class SQSBackend(BaseBackend):
|
||||
else:
|
||||
delay_seconds = queue.delay_seconds
|
||||
|
||||
if len(message_body) > self.maximum_message_size:
|
||||
raise InvalidParameterValue
|
||||
|
||||
message_id = get_random_message_id()
|
||||
message = Message(message_id, message_body)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user