fix SQS message polling to abort after wait_seconds_timeout
This commit is contained in:
parent
bba197e29f
commit
a5727bf64a
1 changed files with 4 additions and 3 deletions
|
|
@ -289,6 +289,10 @@ class SQSBackend(BaseBackend):
|
|||
|
||||
# queue.messages only contains visible messages
|
||||
while True:
|
||||
|
||||
if result or (wait_seconds_timeout and unix_time() > polling_end):
|
||||
break
|
||||
|
||||
if len(queue.messages) == 0:
|
||||
import time
|
||||
time.sleep(0.001)
|
||||
|
|
@ -304,9 +308,6 @@ class SQSBackend(BaseBackend):
|
|||
if len(result) >= count:
|
||||
break
|
||||
|
||||
if result or unix_time() > polling_end:
|
||||
break
|
||||
|
||||
return result
|
||||
|
||||
def delete_message(self, queue_name, receipt_handle):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue