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

Add timeout option #111

Open
elya5 opened this issue Dec 20, 2022 · 5 comments
Open

Add timeout option #111

elya5 opened this issue Dec 20, 2022 · 5 comments
Milestone

Comments

@elya5
Copy link

elya5 commented Dec 20, 2022

Hi

as the crossref API can be a bit slow sometimes, it would be great if there was a timeout option that could be passed to the requests call. As far as I know, this is not possible right now.

Python version: 3.10.8
habanero version: 1.2.2

@sckott
Copy link
Owner

sckott commented Dec 21, 2022

Thanks for the issue.

I have an example here in the docs https://github.com/sckott/habanero/blob/main/habanero/__init__.py#L25-L38 of how to configure curl options, in that example to turn on verbose curl output. I imagine you can also set a timeout using that method but im not sure.

I'd prefer not to change the package api, but may consider it.

@elya5
Copy link
Author

elya5 commented Dec 22, 2022

As far as I can tell, it is not possible to set this via the "curl options way" because the timeout is not a class attribute but passed to the constructor.

However, I do understand your hesitation to change the API.

@sckott
Copy link
Owner

sckott commented Jan 9, 2023

would you want to use timeout across all methods in this library or just certain ones?

@elya5
Copy link
Author

elya5 commented Jan 11, 2023

I am only using the works method. When I'm automatically fetching bigger sets of articles, it occasionally fails/hangs.

@sckott
Copy link
Owner

sckott commented Jan 26, 2024

Sorry for the delay ...

Okay, I'll see about adding this

@sckott sckott modified the milestones: v1.2.6, v2.0 Jan 26, 2024
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

No branches or pull requests

2 participants