From 254666b9f37282b46587532e06d9268aff7eb460 Mon Sep 17 00:00:00 2001 From: Peter Dudfield <34686298+peterdudfield@users.noreply.github.com> Date: Sun, 22 Dec 2024 21:14:34 +0000 Subject: [PATCH 1/3] Update cache.py (#370) --- src/cache.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cache.py b/src/cache.py index a516ea9..2a6789e 100644 --- a/src/cache.py +++ b/src/cache.py @@ -37,6 +37,7 @@ def remove_old_cache( logger.debug(f"Removing {key} from cache, ({value})") keys_to_remove.append(key) + del last_updated_copy logger.debug(f"Removing {len(keys_to_remove)} keys from cache") for key in keys_to_remove: From 1d62a7a0691ef3525cbecf25e3e567cd361b0811 Mon Sep 17 00:00:00 2001 From: BumpVersion Action Date: Sun, 22 Dec 2024 21:14:53 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Bump=20version:=201.5.60=20=E2=86=92=201.5.?= =?UTF-8?q?61=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- src/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1f06ce3..787f07a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 1.5.60 +current_version = 1.5.61 message = Bump version: {current_version} → {new_version} [skip ci] [bumpversion:file:src/main.py] diff --git a/src/main.py b/src/main.py index 3d0847c..7bd7975 100644 --- a/src/main.py +++ b/src/main.py @@ -45,7 +45,7 @@ folder = os.path.dirname(os.path.abspath(__file__)) title = "Quartz Solar API" -version = "1.5.60" +version = "1.5.61" sentry_sdk.init( dsn=os.getenv("SENTRY_DSN"), From 5519975032721f2e5ad3bf689920e1173cf75cf8 Mon Sep 17 00:00:00 2001 From: Peter Dudfield <34686298+peterdudfield@users.noreply.github.com> Date: Sun, 22 Dec 2024 21:16:26 +0000 Subject: [PATCH 3/3] set log level to INFO (#373) * set log level to INFO * isort --- src/database.py | 2 +- src/main.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/database.py b/src/database.py index 472810b..bb77821 100644 --- a/src/database.py +++ b/src/database.py @@ -64,7 +64,7 @@ def get_connection(): """ db_url = os.getenv("DB_URL") if db_url and db_url.find("postgresql") != -1: - return DatabaseConnection(url=db_url) + return DatabaseConnection(url=db_url, echo=False) else: return DummyDBConnection() diff --git a/src/main.py b/src/main.py index 7bd7975..000f920 100644 --- a/src/main.py +++ b/src/main.py @@ -1,5 +1,6 @@ """ Main FastAPI app """ +import logging import os import time from datetime import timedelta @@ -22,6 +23,8 @@ # flake8: noqa E501 +logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) + structlog.configure( processors=[ structlog.processors.EventRenamer("message", replace_by="_event"),