From 112f280dd3cff85039e78c082b823db068aad44d Mon Sep 17 00:00:00 2001 From: Mark Bakhit <16909269+Archmonger@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:39:05 -0700 Subject: [PATCH] v3.2.0 (#149) --- CHANGELOG.md | 9 +++++++-- src/reactpy_django/__init__.py | 2 +- src/reactpy_django/utils.py | 9 +++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be5f1982..dcda688d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,9 +34,13 @@ Using the following categories, list your changes in this order: ## [Unreleased] +- Nothing (yet) + +## [3.2.0] - 2023-06-08 + ### Added -- Added warning if poor system/cache/database performance is detected. +- Added warning if poor system/cache/database performance is detected while in `DEBUG` mode. - Added `REACTPY_AUTH_BACKEND` setting to allow for custom authentication backends. ### Changed @@ -285,7 +289,8 @@ Using the following categories, list your changes in this order: - Support for IDOM within the Django -[unreleased]: https://github.com/reactive-python/reactpy-django/compare/3.1.0...HEAD +[unreleased]: https://github.com/reactive-python/reactpy-django/compare/3.2.0...HEAD +[3.2.0]: https://github.com/reactive-python/reactpy-django/compare/3.1.0...3.2.0 [3.1.0]: https://github.com/reactive-python/reactpy-django/compare/3.0.1...3.1.0 [3.0.1]: https://github.com/reactive-python/reactpy-django/compare/3.0.0-reactpy...3.0.1 [3.0.0-reactpy]: https://github.com/reactive-python/reactpy-django/compare/3.0.0...3.0.0-reactpy diff --git a/src/reactpy_django/__init__.py b/src/reactpy_django/__init__.py index 195626aa..0d8bb188 100644 --- a/src/reactpy_django/__init__.py +++ b/src/reactpy_django/__init__.py @@ -2,7 +2,7 @@ from reactpy_django.websocket.paths import REACTPY_WEBSOCKET_PATH -__version__ = "3.1.0" +__version__ = "3.2.0" __all__ = [ "REACTPY_WEBSOCKET_PATH", "hooks", diff --git a/src/reactpy_django/utils.py b/src/reactpy_django/utils.py index c44429ee..da973a60 100644 --- a/src/reactpy_django/utils.py +++ b/src/reactpy_django/utils.py @@ -313,7 +313,12 @@ def create_cache_key(*args): def db_cleanup(immediate: bool = False): """Deletes expired component sessions from the database. This function may be expanded in the future to include additional cleanup tasks.""" - from .config import REACTPY_CACHE, REACTPY_DATABASE, REACTPY_RECONNECT_MAX + from .config import ( + REACTPY_CACHE, + REACTPY_DATABASE, + REACTPY_DEBUG_MODE, + REACTPY_RECONNECT_MAX, + ) from .models import ComponentSession clean_started_at = datetime.now() @@ -344,7 +349,7 @@ def db_cleanup(immediate: bool = False): # Check if cleaning took abnormally long clean_duration = datetime.now() - clean_started_at - if clean_duration.total_seconds() > 1: + if REACTPY_DEBUG_MODE and clean_duration.total_seconds() > 1: _logger.warning( "ReactPy has taken %s seconds to clean up expired component sessions. " "This may indicate a performance issue with your system, cache, or database.",