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

Adjust default timeouts #132

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/enochecker/enochecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import requests

DEFAULT_TIMEOUT: float = 30
TIME_BUFFER: float = 5 # time in seconds we try to finish earlier
TIME_BUFFER: float = 2 # time in seconds we try to finish earlier

# Global cache for all stored dicts. TODO: Prune this at some point?
global_db_cache: Dict[str, Union[StoredDict, NoSqlDict]] = {}
Expand Down Expand Up @@ -683,7 +683,7 @@ def timeout_fun() -> float:
else:

def timeout_fun() -> float:
return self.time_remaining / 2
return self.time_remaining

if port is None:
port = self.port
Expand Down Expand Up @@ -837,7 +837,7 @@ def http(
kwargs.setdefault("allow_redirects", False)
url = self._sanitize_url(route, port, scheme)
if timeout is None:
timeout = self.time_remaining / 2
timeout = self.time_remaining
self.debug(
"Request: {} {} with params: {} and {} secs timeout.".format(
method, url, params, timeout
Expand Down