mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-08 08:28:24 -04:00
fix static scan warnings
This commit is contained in:
@@ -33,6 +33,7 @@ class DocumentDownloadClient:
|
|||||||
"document": file_contents,
|
"document": file_contents,
|
||||||
"is_csv": is_csv or False,
|
"is_csv": is_csv or False,
|
||||||
},
|
},
|
||||||
|
timeout=30
|
||||||
)
|
)
|
||||||
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class PerformancePlatformClient:
|
|||||||
self.performance_platform_url + payload["dataType"],
|
self.performance_platform_url + payload["dataType"],
|
||||||
json=payload,
|
json=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
|
timeout=30
|
||||||
)
|
)
|
||||||
|
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ def cronitor(task_name):
|
|||||||
params={
|
params={
|
||||||
"host": current_app.config["API_HOST_NAME"],
|
"host": current_app.config["API_HOST_NAME"],
|
||||||
},
|
},
|
||||||
|
timeout=30
|
||||||
)
|
)
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ def get_certificate(url):
|
|||||||
res = redis_store.get(url)
|
res = redis_store.get(url)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
return res
|
return res
|
||||||
res = requests.get(url).text
|
res = requests.get(url, timeout=30).text
|
||||||
redis_store.set(url, res, ex=60 * 60) # 60 minutes
|
redis_store.set(url, res, ex=60 * 60) # 60 minutes
|
||||||
_signing_cert_cache[url] = res
|
_signing_cert_cache[url] = res
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ def sns_notification_handler(data, headers):
|
|||||||
if "SubscribeUrl" in message
|
if "SubscribeUrl" in message
|
||||||
else message.get("SubscribeURL")
|
else message.get("SubscribeURL")
|
||||||
)
|
)
|
||||||
response = requests.get(url)
|
response = requests.get(url, timeout=30)
|
||||||
try:
|
try:
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ def confirm_subscription(confirmation_request):
|
|||||||
current_app.logger.warning("SubscribeURL does not exist or empty")
|
current_app.logger.warning("SubscribeURL does not exist or empty")
|
||||||
return
|
return
|
||||||
|
|
||||||
response = requests.get(url)
|
response = requests.get(url, timeout=30)
|
||||||
try:
|
try:
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user