Skip to content

Commit

Permalink
v3.2.0 (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger authored Jun 23, 2023
1 parent a884af3 commit 112f280
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/reactpy_django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 7 additions & 2 deletions src/reactpy_django/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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.",
Expand Down

0 comments on commit 112f280

Please sign in to comment.