Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Code clean up and timeout support #12

Closed
wants to merge 3 commits into from

Conversation

Sapphire64
Copy link

Hello

We had problems with blocking processes in our project. Emails were sent using celery, and sometimes all workers become unavailable after sending bunch of emails. I tried some basic testing with requests library and it seems like mailgun got no real timeout, so if connection exists it can last for a while. I've added an option to explicitly specify timeout period using requests' timeout kwarg. It can be None or float value. If connection will not be closed after some reasonable time this option will kill it. I think this option should be helpful, and yet it is optional.

Also I've some basic PEP8 and clean up of the code and project, hope you will enjoy it.

Logging in celery:
[2014-06-13 07:23:09,034: INFO/Worker-3] Starting new HTTPS connection (1): api.mailgun.net
[2014-06-13 07:23:09,522: WARNING/Worker-3] HTTPSConnectionPool(host='api.mailgun.net', port=443): Request timed out. (timeout=0.0001)

@pydanny
Copy link
Collaborator

pydanny commented Sep 10, 2015

Apologies, but this has been superseded by other work. However, please do not hesitate to volunteer future code contributions.

@pydanny pydanny closed this Sep 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants