Skip to content
Snippets Groups Projects
Commit eca9a096 authored by David Douard's avatar David Douard
Browse files

Do not log exceptions if history_counters_url is not set

Prevent polluting the logs, especially in cypress tests.
parent 5cb4219c
No related branches found
No related tags found
1 merge request!1373Several refactorings trying to simplify a bit a few things
......@@ -41,12 +41,13 @@ def stat_counters(request):
url = get_config()["history_counters_url"]
stat_counters_history = {}
try:
response = requests.get(url, timeout=5)
stat_counters_history = json.loads(response.text)
except Exception as exc:
logger.exception(exc)
sentry_capture_exception(exc)
if url:
try:
response = requests.get(url, timeout=5)
stat_counters_history = json.loads(response.text)
except Exception as exc:
logger.exception(exc)
sentry_capture_exception(exc)
counters = {
"stat_counters": stat_counters,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment