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

fix: add more forgiving timeout duration for sdn backup #87

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def handle(self, *args, **options):
# download the CSV locally, to check size and pass along to import
threshold = options['threshold']
url = settings.CONSOLIDATED_SCREENING_LIST_URL
timeout = settings.SDN_CHECK_REQUEST_TIMEOUT
timeout = settings.SDN_BACKUP_REQUEST_TIMEOUT

with requests.Session() as s:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_timeout_exception(self):
self.LOGGER_NAME,
'WARNING',
"Sanctions SDNFallback: DOWNLOAD FAILURE: Timeout occurred trying to download SDN CSV. "
"Timeout threshold (in seconds): 5"
"Timeout threshold (in seconds): 15"
)
)

Expand Down
1 change: 1 addition & 0 deletions sanctions/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def root(*path_fragments):

# SDN Check
SDN_CHECK_REQUEST_TIMEOUT = 5 # Value is in seconds.
SDN_BACKUP_REQUEST_TIMEOUT = 15 # Value is in seconds.
# Settings to download the government CSL
CONSOLIDATED_SCREENING_LIST_URL = 'https://data.trade.gov/downloadable_consolidated_screening_list/v1/consolidated.csv'
# Settings to check government purchase restriction lists
Expand Down
Loading