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

#337 Set default timeout on ISBN search. #342

Merged
merged 2 commits into from
Jul 27, 2022
Merged

Conversation

xihh87
Copy link
Contributor

@xihh87 xihh87 commented Jul 15, 2022

I've reduced the scope of changes on #338 as requested:

So in the interest of quickly merging, can we reduce this PR (or a new one) to just address the requests that are known to timeout?

Originally posted by @dhimmel in #338 (comment)**

This change is only configurable on source code in the global variable defined on isbn search file.

Copy link
Member

@dhimmel dhimmel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than comment looks good.

Comment on lines 19 to 22
import isbnlib

isbnlib.config.setthreadstimeout(seconds=timeout_seconds)
isbnlib.config.seturlopentimeout(seconds=timeout_seconds)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slight preference for us to define a helper like import_isbnlib such that we don't have to repeat this configuration 3 times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a helper preferable to using only a global import and config for the library at the top of the module?

This is an ISBN getting module anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a helper preferable to using only a global import and config for the library at the top of the module?

Usually not, although in this case let's assume we added the lazy importing of isbnlib for a reason and keep it that way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xihh87 did you want to switch this to use a helper so we can merge?

@dhimmel dhimmel merged commit 29dec5b into manubot:main Jul 27, 2022
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