Skip to content

Commit

Permalink
fix(settings): match default timeout to benefits
Browse files Browse the repository at this point in the history
makes the default setting more useful
  • Loading branch information
thekaveman committed Sep 26, 2023
1 parent bf38280 commit 5204fa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions eligibility_server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
DEBUG_MODE = True
HOST = "0.0.0.0" # nosec
LOG_LEVEL = "INFO"
REQUEST_TIMEOUT = 5
REQUEST_TIMEOUT = (3, 20)

# Database settings

Expand Down Expand Up @@ -65,7 +65,7 @@ def log_level(self):

@property
def request_timeout(self):
return int(current_app.config["REQUEST_TIMEOUT"])
return current_app.config["REQUEST_TIMEOUT"]

# API settings

Expand Down
3 changes: 2 additions & 1 deletion tests/test_keypair.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from eligibility_server import keypair
from eligibility_server.keypair import _read_key_file
from eligibility_server.settings import REQUEST_TIMEOUT


@pytest.fixture
Expand Down Expand Up @@ -50,7 +51,7 @@ def test_read_key_file_remote(sample_key_path_remote, spy_open, spy_requests_get
# check that there was no call to open
assert spy_open.call_count == 0
# check that we made a get request
spy_requests_get.assert_called_once_with(sample_key_path_remote, timeout=5)
spy_requests_get.assert_called_once_with(sample_key_path_remote, timeout=REQUEST_TIMEOUT)
assert key
assert key == requests.get(sample_key_path_remote, timeout=5).text.encode("utf8")

Expand Down

0 comments on commit 5204fa2

Please sign in to comment.