mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 14:57:42 +00:00
Autogenerated type safety parameterisation of all methods
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from collections import Counter
|
||||
@@ -11,6 +13,7 @@ from tornado.web import Application
|
||||
|
||||
from core.constants import BANDS
|
||||
from core.enums import Continent
|
||||
from core.live_data_cache import LiveDataCache
|
||||
from core.utils import safe_json_dumps
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -24,17 +27,17 @@ class APIDxStatsHandler(tornado.web.RequestHandler):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
application: "Application",
|
||||
application: Application,
|
||||
request: httputil.HTTPServerRequest,
|
||||
**kwargs: Any,
|
||||
):
|
||||
self._spots = None
|
||||
) -> None:
|
||||
self._spots: LiveDataCache | None = None
|
||||
super().__init__(application, request, **kwargs)
|
||||
|
||||
def initialize(self, spots):
|
||||
def initialize(self, spots: LiveDataCache) -> None:
|
||||
self._spots = spots
|
||||
|
||||
def get(self):
|
||||
def get(self) -> None:
|
||||
try:
|
||||
one_hour_ago = (datetime.now(pytz.UTC) - timedelta(hours=1)).timestamp()
|
||||
counts = Counter()
|
||||
|
||||
Reference in New Issue
Block a user