Skip to content

Commit

Permalink
fix: add more forgiving timeout duration for sdn backup (#87)
Browse files Browse the repository at this point in the history
* fix: add more forgiving timeout duration for sdn backup

* chore: quality
  • Loading branch information
christopappas authored Dec 19, 2024
1 parent 0999877 commit d00ba77
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
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

0 comments on commit d00ba77

Please sign in to comment.