From 3a45fc9df6baeb0473fa39f123f05614a4c6c8bc Mon Sep 17 00:00:00 2001 From: Chris Pappas Date: Wed, 18 Dec 2024 16:05:57 -0500 Subject: [PATCH] fix: add more forgiving timeout duration for sdn backup --- .../commands/populate_sdn_fallback_data_and_metadata.py | 2 +- sanctions/settings/base.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sanctions/apps/sanctions/management/commands/populate_sdn_fallback_data_and_metadata.py b/sanctions/apps/sanctions/management/commands/populate_sdn_fallback_data_and_metadata.py index ecb06bd..8a80eab 100644 --- a/sanctions/apps/sanctions/management/commands/populate_sdn_fallback_data_and_metadata.py +++ b/sanctions/apps/sanctions/management/commands/populate_sdn_fallback_data_and_metadata.py @@ -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: diff --git a/sanctions/settings/base.py b/sanctions/settings/base.py index 01e857e..48cbc37 100644 --- a/sanctions/settings/base.py +++ b/sanctions/settings/base.py @@ -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