Fix- Raise InvalidParameterValue when change visibility timeout is mo… (#3893)
* Fix- Raise InvalidParameterValue when change visibility timeout is more than permitted * Fix review comments * Modified tests * Fix tests * change * Change client * Fix tests * fix tests * fix tests * change tests * Fix tests * changed tests * Fix tests * Fix tests * Change message
This commit is contained in:
parent
03b2009a1c
commit
abc62b360d
2 changed files with 47 additions and 1 deletions
|
|
@ -887,6 +887,17 @@ class SQSBackend(BaseBackend):
|
|||
if message.receipt_handle == receipt_handle:
|
||||
if message.visible:
|
||||
raise MessageNotInflight
|
||||
|
||||
visibility_timeout_msec = int(visibility_timeout) * 1000
|
||||
given_visibility_timeout = unix_time_millis() + visibility_timeout_msec
|
||||
if given_visibility_timeout - message.sent_timestamp > 43200 * 1000:
|
||||
raise InvalidParameterValue(
|
||||
"Value {0} for parameter VisibilityTimeout is invalid. Reason: Total "
|
||||
"VisibilityTimeout for the message is beyond the limit [43200 seconds]".format(
|
||||
visibility_timeout
|
||||
)
|
||||
)
|
||||
|
||||
message.change_visibility(visibility_timeout)
|
||||
if message.visible:
|
||||
# If the message is visible again, remove it from pending
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue