From 5e8b2d7a5a195e96bb199924d1fc055cbfee86ed Mon Sep 17 00:00:00 2001 From: Raoul Linnenbank <58594297+rflinnenbank@users.noreply.github.com> Date: Mon, 15 May 2023 08:37:59 +0200 Subject: [PATCH] [2023-05-15 08:22] Fixed an issue with the multi-location version of the get_weather router method. (#102) (#103) Signed-off-by: Raoul Linnenbank <58594297+rflinnenbank@users.noreply.github.com> --- .../routers/weather/api_view_v2.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/weather_provider_api/routers/weather/api_view_v2.py b/weather_provider_api/routers/weather/api_view_v2.py index 2125239..e70e3d5 100644 --- a/weather_provider_api/routers/weather/api_view_v2.py +++ b/weather_provider_api/routers/weather/api_view_v2.py @@ -187,13 +187,15 @@ async def get_alarm(): # pragma: no cover # Handler for requests with multiple locations: @app.get("/sources/{source_id}/models/{model_id}/multiple-locations/", tags=["sync"]) +@API_RATE_LIMITER.limit("5/minute") async def get_sync_weather_multi_loc( - source_id: str, - model_id: str, - cleanup_tasks: BackgroundTasks, - ret_args: WeatherContentRequestMultiLocationQuery = Depends(), - fmt_args: WeatherFormattingRequestQuery = Depends(), - accept: str = Depends(header_accept_type), + request: Request, + source_id: str, + model_id: str, + cleanup_tasks: BackgroundTasks, + ret_args: WeatherContentRequestMultiLocationQuery = Depends(), + fmt_args: WeatherFormattingRequestQuery = Depends(), + accept: str = Depends(header_accept_type), ): # pragma: no cover starting_time = datetime.utcnow() logger.info(f"WeatherRequest({starting_time}): {request.url}", datetime=datetime.utcnow())