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

requests needs a timeout #68

Open
camerondavison opened this issue Dec 16, 2024 · 1 comment
Open

requests needs a timeout #68

camerondavison opened this issue Dec 16, 2024 · 1 comment

Comments

@camerondavison
Copy link

This was solved in the singer tap like https://github.com/singer-io/tap-salesforce/pull/114/commits

By default requests does not have any connect timeout https://requests.readthedocs.io/en/latest/user/advanced/#timeouts but it should

This is the currently recommended way to set timeout for simple salesforce as far as I know

simple-salesforce/simple-salesforce#148 (comment)


This is causing problems for our cronjob which is periodically freezing due to some dropped packet that then leaves the connection open.

@edgarrmondragon
Copy link
Member

Hi @camerondavison! PRs welcome, I think it should as easy as updating some lines here

def _make_request(self, http_method, url, headers=None, body=None, stream=False, params=None):
if http_method == "GET":
LOGGER.info("Making %s request to %s with params: %s", http_method, url, params)
resp = self.session.get(url, headers=headers, stream=stream, params=params)
elif http_method == "POST":
LOGGER.info("Making %s request to %s with body %s", http_method, url, body)
resp = self.session.post(url, headers=headers, data=body)
else:
raise TapSalesforceException("Unsupported HTTP method")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants