Skip to content

Conversation

@lonvia
Copy link
Member

@lonvia lonvia commented Nov 8, 2022

The requests library seems to ignore socket timeouts with the result that newer versions of the pyosmium tools may hang again on a bad network connection. There is no global parameter to set timeouts in requests, so the whole code needs to be rearranged a bit.

ReplicationServer now has an extra function set_request_parameter() with which extra parameters for requests.get() can be set. This is not only used for timeouts but also to hand in the cookies.

Overwriting the open_url() function should no longer be necessary. You can set proxies, authentication, certificates etc. all with the new function.

Cookies can now be handed in as an extra parameter for the requests
library.
Using a function instead of a parameter in __init__ is easier
to handle and makes it simple to detect if the new functionality
is available.
@lonvia lonvia merged commit 71bcf2e into osmcode:master Nov 9, 2022
@lonvia lonvia deleted the fix-socket-timeouts-again branch November 9, 2022 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant