Change to accept delay_sec as 0 sec#46
Open
kawasin73 wants to merge 1 commit into
Open
Conversation
timnd
suggested changes
Dec 11, 2019
| sqs_queue.send_message( | ||
| MessageBody=kale_msg.encode(), | ||
| DelaySeconds=delay_sec or 1 | ||
| DelaySeconds=delay_sec or 0 |
Contributor
There was a problem hiding this comment.
A more appropriate backwards compatible change would be to change the default value in the parameter list to delay_sec=1 and remove the delay_sec is not None check above (L35). The parameter is an int therefore None can be expected to raise a TypeError. Then change this line to DelaySeconds=delay_sec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is impossible to set
0DelaySeconds (Execute Immediately) forSendMessageatPublisher.publish()becausedelay_sec or 1is recognized as1whendelay_sec == 0.DelaySecondsforsend_message()does not acceptNonebut onlyint. It is reasonable to checkdelay_secisNoneor not byor. But i think the fallback value should be0.