boto / boto

For the latest version of boto, see https://github.com/boto/boto3 -- Python interface to Amazon Web Services

Home Page:http://docs.pythonboto.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQS connection.send_message() does not set message delay with delay_seconds = 0

koreindian opened this issue · comments

I noticed that when standard queues have a delay time set, that messages which are being sent to that queue are not delayed when specifying their delay_seconds to be 0. This is due to the following bad conditional logic in boto/sqs/connection.py which treats 0 like None:

     def send_message(self, queue, message_content, delay_seconds=None,
message_attributes=None): 
      ... 
         if delay_seconds: 
              params['DelaySeconds'] = int(delay_seconds)
      ...