mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 06:17:41 +00:00
Compare commits
2
Commits
2.1.2
...
0eb4553406
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0eb4553406 | ||
|
|
682e2c267c |
@@ -4,7 +4,7 @@ from threading import Event, Thread
|
||||
|
||||
import pytz
|
||||
import requests
|
||||
from requests.exceptions import ConnectionError, ConnectTimeout, ReadTimeout
|
||||
from requests.exceptions import ConnectionError, ConnectTimeout, JSONDecodeError, ReadTimeout
|
||||
|
||||
from core.constants import HTTP_HEADERS
|
||||
from providers.alert.alert_provider import AlertProvider
|
||||
@@ -64,9 +64,14 @@ class HTTPAlertProvider(AlertProvider):
|
||||
logger.warning(f"HTTP {http_response.status_code} when calling {self.name} alerts API.")
|
||||
|
||||
except ConnectionError:
|
||||
self.status = "Error"
|
||||
logger.warning(f"Connection error when accessing {self.name} alerts API.")
|
||||
except (ConnectTimeout, ReadTimeout):
|
||||
self.status = "Error"
|
||||
logger.warning(f"Timeout when accessing {self.name} alerts API.")
|
||||
except JSONDecodeError:
|
||||
self.status = "Error"
|
||||
logger.warning(f"Invalid or empty JSON response from {self.name} alert API.")
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logger.exception(f"Exception in HTTP JSON Alert Provider ({self.name})")
|
||||
|
||||
@@ -4,7 +4,7 @@ from threading import Event, Thread
|
||||
|
||||
import pytz
|
||||
import requests
|
||||
from requests.exceptions import ConnectionError, ConnectTimeout, ReadTimeout
|
||||
from requests.exceptions import ConnectionError, ConnectTimeout, JSONDecodeError, ReadTimeout
|
||||
|
||||
from core.constants import HTTP_HEADERS
|
||||
from providers.spot.spot_provider import SpotProvider
|
||||
@@ -73,9 +73,14 @@ class HTTPSpotProvider(SpotProvider):
|
||||
logger.warning(f"HTTP {http_response.status_code} when calling {self.name} spot API.")
|
||||
|
||||
except ConnectionError:
|
||||
self.status = "Error"
|
||||
logger.warning(f"Connection error when accessing {self.name} spots API.")
|
||||
except (ConnectTimeout, ReadTimeout):
|
||||
self.status = "Error"
|
||||
logger.warning(f"Timeout when accessing {self.name} spots API.")
|
||||
except JSONDecodeError:
|
||||
self.status = "Error"
|
||||
logger.warning(f"Invalid or empty JSON response from {self.name} spots API.")
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logger.exception(f"Exception in HTTP Spot Provider ({self.name})")
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/static/js/add-spot.js?v=1789803195"></script>
|
||||
<script src="/static/js/add-spot.js?v=1789811377"></script>
|
||||
<script>$(document).ready(function () {
|
||||
$("#nav-link-add-spot").addClass("active");
|
||||
}); <!-- highlight active page in nav --></script>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/static/js/alerts.js?v=1789803195"></script>
|
||||
<script src="/static/js/alerts.js?v=1789811377"></script>
|
||||
<script>$(document).ready(function () {
|
||||
$("#nav-link-alerts").addClass("active");
|
||||
}); <!-- highlight active page in nav --></script>
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1789803195"></script>
|
||||
<script src="/static/js/bands.js?v=1789803195"></script>
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1789811377"></script>
|
||||
<script src="/static/js/bands.js?v=1789811377"></script>
|
||||
<script>$(document).ready(function () {
|
||||
$("#nav-link-bands").addClass("active");
|
||||
}); <!-- highlight active page in nav --></script>
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{% extends "skeleton.html" %}
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/css/style.css?v=1789803195" type="text/css">
|
||||
<link rel="stylesheet" href="/static/css/style.css?v=1789811377" type="text/css">
|
||||
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
|
||||
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
|
||||
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
|
||||
@@ -16,10 +16,10 @@
|
||||
window.fetchEventSource = fetchEventSource;
|
||||
</script>
|
||||
|
||||
<script src="/static/js/utils.js?v=1789803195"></script>
|
||||
<script src="/static/js/ui-ham.js?v=1789803195"></script>
|
||||
<script src="/static/js/geo.js?v=1789803195"></script>
|
||||
<script src="/static/js/common.js?v=1789803195"></script>
|
||||
<script src="/static/js/utils.js?v=1789811377"></script>
|
||||
<script src="/static/js/ui-ham.js?v=1789811377"></script>
|
||||
<script src="/static/js/geo.js?v=1789811377"></script>
|
||||
<script src="/static/js/common.js?v=1789811377"></script>
|
||||
{% end %}
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
|
||||
<script src="/static/js/conditions.js?v=1789803195"></script>
|
||||
<script src="/static/js/conditions.js?v=1789811377"></script>
|
||||
<script>$(document).ready(function () {
|
||||
$("#nav-link-conditions").addClass("active");
|
||||
}); <!-- highlight active page in nav --></script>
|
||||
|
||||
+2
-2
@@ -113,8 +113,8 @@
|
||||
const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}";
|
||||
</script>
|
||||
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1789803195"></script>
|
||||
<script src="/static/js/map.js?v=1789803195"></script>
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1789811377"></script>
|
||||
<script src="/static/js/map.js?v=1789811377"></script>
|
||||
<script>$(document).ready(function () {
|
||||
$("#nav-link-map").addClass("active");
|
||||
}); <!-- highlight active page in nav --></script>
|
||||
|
||||
@@ -125,8 +125,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1789803195"></script>
|
||||
<script src="/static/js/spots.js?v=1789803195"></script>
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1789811377"></script>
|
||||
<script src="/static/js/spots.js?v=1789811377"></script>
|
||||
<script>$(document).ready(function () {
|
||||
$("#nav-link-spots").addClass("active");
|
||||
}); <!-- highlight active page in nav --></script>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/status.js?v=1789803195"></script>
|
||||
<script src="/static/js/status.js?v=1789811377"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#nav-link-status").addClass("active");
|
||||
|
||||
Reference in New Issue
Block a user