Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow request post and get to timeout #37

Merged
merged 8 commits into from
Nov 8, 2022

Conversation

abulgher
Copy link
Contributor

@abulgher abulgher commented Oct 1, 2022

According to the requests documentation all production codes should implement a Timeout for all requests to avoid application hanging and freezing due to a unresponsive server.

I have added a timeout parameter to all methods invoking a post or get requests. The timeout is by default None, it means that the API structure is not modified, as proved in the test suite. In the test suite, I have added a test with a very short timeout to prove the functionality of the newly introduced feature.

When a timeout is occurring, a new elog exception is raised so that the API user can handle it.

abulgher and others added 8 commits August 22, 2022 13:19
Added the content-type to the tupla
text/html;charset=utf-8
It looks like that the elog server is expecting to receive latin-1 encoded
bytes but requests is sending the message a standard UTF-8 encoded string.
To avoid this problem the message and the string attribute values are
encoded in l1 before sending the request.
Capability to post and read back messages / attributes with special characters
…request.

Update documentation.

Add a test case to demonstrate the functionality.
@simongregorebner simongregorebner merged commit 3693184 into paulscherrerinstitute:master Nov 8, 2022
@abulgher abulgher deleted the timeout branch December 8, 2022 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants