mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-09 11:34:07 +00:00
catch special async timeout error in servers
In Python <= 3.10 this is not yet the same as TimeoutError. Fixes #3303.
This commit is contained in:
@@ -10,6 +10,7 @@ Server implementation using the starlette webserver framework.
|
||||
from typing import Any, Optional, Mapping, Callable, cast, Coroutine, Dict, Awaitable
|
||||
from pathlib import Path
|
||||
import datetime as dt
|
||||
import asyncio
|
||||
|
||||
from starlette.applications import Starlette
|
||||
from starlette.routing import Route
|
||||
@@ -144,7 +145,8 @@ def get_application(project_dir: Path,
|
||||
middleware.append(Middleware(FileLoggingMiddleware, file_name=log_file))
|
||||
|
||||
exceptions: Dict[Any, Callable[[Request, Exception], Awaitable[Response]]] = {
|
||||
TimeoutError: timeout_error
|
||||
TimeoutError: timeout_error,
|
||||
asyncio.TimeoutError: timeout_error
|
||||
}
|
||||
|
||||
async def _shutdown() -> None:
|
||||
|
||||
Reference in New Issue
Block a user