Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kalaspuff/tomodachi
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuff committed Aug 28, 2019
2 parents d55fee9 + 7d00988 commit 22e36ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ tests:
PYTHONPATH=. python tomodachi.py run tests/run_example_service.py
PYTHONPATH=. python setup.py check -r -s

pytest:
if [[ ! "${PYTEST_INSTALLED}" ]]; then make development; fi
PYTHONPATH=. py.test -n auto tests/

_check_release:
if [[ "${RELEASED}" ]]; then echo "Version ${VERSION} is already released"; exit 1; fi

Expand Down
7 changes: 6 additions & 1 deletion tomodachi/transport/aws_sns_sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ async def subscribe_handler(cls: Any, obj: Any, context: Dict, func: Any, topic:

async def handler(payload: Optional[str], receipt_handle: Optional[str] = None, queue_url: Optional[str] = None, message_topic: str = '') -> Any:
if not payload or payload == DRAIN_MESSAGE_PAYLOAD:
await cls.delete_message(cls, receipt_handle, queue_url, context)
try:
await cls.delete_message(cls, receipt_handle, queue_url, context)
except Exception:
pass
return

_callback_kwargs = callback_kwargs # type: Any
Expand Down Expand Up @@ -342,6 +345,8 @@ async def delete_message(cls: Any, receipt_handle: Optional[str], queue_url: Opt

async def _delete_message() -> None:
for retry in range(1, 4):
if not cls.clients or not cls.clients.get('sqs'):
cls.create_client(cls, 'sqs', context)
client = cls.clients.get('sqs')
try:
await asyncio.wait_for(client.delete_message(ReceiptHandle=receipt_handle, QueueUrl=queue_url), timeout=30)
Expand Down

0 comments on commit 22e36ed

Please sign in to comment.