mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-09 11:34:07 +00:00
use new QueryStatistics in API server
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This file is part of Nominatim. (https://nominatim.org)
|
||||
#
|
||||
# Copyright (C) 2024 by the Nominatim developer community.
|
||||
# Copyright (C) 2025 by the Nominatim developer community.
|
||||
# For a full list of authors see the git log.
|
||||
"""
|
||||
Base abstraction for implementing based on different ASGI frameworks.
|
||||
@@ -13,6 +13,7 @@ import math
|
||||
|
||||
from ..config import Configuration
|
||||
from ..core import NominatimAPIAsync
|
||||
from ..types import QueryStatistics
|
||||
from ..result_formatting import FormatDispatcher
|
||||
from .content_types import CONTENT_TEXT
|
||||
|
||||
@@ -68,6 +69,12 @@ class ASGIAdaptor(abc.ABC):
|
||||
""" Return the formatting object to use.
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def query_stats(self) -> Optional[QueryStatistics]:
|
||||
""" Return the object for saving query statistics or None if
|
||||
no statistics are required.
|
||||
"""
|
||||
|
||||
def get_int(self, name: str, default: Optional[int] = None) -> int:
|
||||
""" Return an input parameter as an int. Raises an exception if
|
||||
the parameter is given but not in an integer format.
|
||||
|
||||
Reference in New Issue
Block a user