-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2023-01-30 19:45] Fix for Arome and added slowapi ratelimiter FIXED: - Due to the unusual selection of files for the KDP, it was possible for requests earlier than the currently available dataset file to come up with the oldest file, rather than no file at all. This has been accommodated for. Signed-off-by: Raoul Linnenbank <[email protected]> ADDED: - Basic SlowAPI support was added with some initial settings. In the future we'll expand upon this and move it to the app config.
- Loading branch information
1 parent
76e5101
commit ca0e929
Showing
7 changed files
with
480 additions
and
396 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "weather_provider_api" | ||
version = "2.34.0" | ||
version = "2.35.0" | ||
description = "Weather Provider Libraries and API" | ||
authors = ["Verbindingsteam", "Raoul Linnenbank <[email protected]>"] | ||
license = "MPL-2.0" | ||
|
@@ -30,7 +30,7 @@ pandas = "^1.5.2" | |
xarray = "^2022.12.0" | ||
cfgrib = "^0.9.10.3" | ||
uvicorn = "^0.20.0" | ||
gevent = "^22.10.2" | ||
slowapi = "^0.1.7" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^7.2.0" | ||
|
@@ -39,6 +39,7 @@ pytest-cov = "^4.0.0" | |
isort = "^5.10.1" | ||
black = "^22.10.0" | ||
jupyter = "^1.0.0" | ||
pylint = "^2.15.10" | ||
|
||
|
||
[tool.poetry.scripts] | ||
|
@@ -50,6 +51,9 @@ wpla_clear_era5land = "weather_provider_api.scripts.erase_era5land_repository:ma | |
wpla_clear_arome = "weather_provider_api.scripts.erase_arome_repository:main" | ||
wpla_run_api = "weather_provider_api.main:main" | ||
|
||
[tool.pylint] | ||
max-line-length = 120 | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# SPDX-FileCopyrightText: 2019-2023 Alliander N.V. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
# !/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from slowapi import Limiter | ||
from slowapi.util import get_remote_address | ||
|
||
|
||
API_RATE_LIMITER = Limiter(key_func=get_remote_address, default_limits=["5/minute"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.