dataviz: do not log failure to update statistics as errors (#85742)
This commit is contained in:
parent
5fb21cd6ec
commit
8a15bacc72
|
@ -1,6 +1,7 @@
|
|||
import json
|
||||
|
||||
from django.conf import settings
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from combo.utils import requests
|
||||
|
||||
|
@ -22,15 +23,18 @@ def update_available_statistics():
|
|||
url = '/visualization/json/' if provider == 'bijoe' else '/api/statistics/'
|
||||
|
||||
for site_key, site_dict in sites.items():
|
||||
response = requests.get(
|
||||
url,
|
||||
allow_redirects=False,
|
||||
timeout=5,
|
||||
remote_service=site_dict if provider in settings.KNOWN_SERVICES else {},
|
||||
without_user=True,
|
||||
headers={'accept': 'application/json'},
|
||||
)
|
||||
if response.status_code != 200:
|
||||
try:
|
||||
response = requests.get(
|
||||
url,
|
||||
allow_redirects=False,
|
||||
timeout=5,
|
||||
remote_service=site_dict if provider in settings.KNOWN_SERVICES else {},
|
||||
without_user=True,
|
||||
headers={'accept': 'application/json'},
|
||||
log_errors='warn',
|
||||
)
|
||||
response.raise_for_status()
|
||||
except RequestException:
|
||||
continue
|
||||
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue