From ba43d3b9b125547e49cfb9134b49844973f5492e Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Sanchez Date: Tue, 10 Dec 2024 11:29:42 -0300 Subject: [PATCH 1/2] Make channels_layer group_expiry parameter configurable through an environment variable. --- manager/manager/settings.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/manager/manager/settings.py b/manager/manager/settings.py index 76f21255..d4b6568b 100644 --- a/manager/manager/settings.py +++ b/manager/manager/settings.py @@ -106,10 +106,7 @@ "love-nginx", SERVER_URL, ] -CSRF_TRUSTED_ORIGINS = [ - f"https://{SERVER_URL}", - f"http://{SERVER_URL}" -] +CSRF_TRUSTED_ORIGINS = [f"https://{SERVER_URL}", f"http://{SERVER_URL}"] """List of Django allowed hosts (`list` of `string`)""" # Application definition @@ -254,6 +251,7 @@ REDIS_PASS = os.environ.get("REDIS_PASS", False) REDIS_CONFIG_EXPIRY = int(os.environ.get("REDIS_CONFIG_EXPIRY", 60)) REDIS_CONFIG_CAPACITY = int(os.environ.get("REDIS_CONFIG_CAPACITY", 100)) +REDIS_CONFIG_GROUP_EXPIRY = int(os.environ.get("REDIS_CONFIG_GROUP_EXPIRY", 43200)) if REDIS_HOST and not TESTING: CHANNEL_LAYERS = { "default": { @@ -270,11 +268,7 @@ ], "expiry": REDIS_CONFIG_EXPIRY, "capacity": REDIS_CONFIG_CAPACITY, - # Set group_expiry to 1 year to avoid group messages being - # dropped when the group is not used frequently. - # TODO: Solve this particular issue in a better way. - # See: DM-41728 - "group_expiry": 31536000, + "group_expiry": REDIS_CONFIG_GROUP_EXPIRY, }, }, } From a149fc2a2a9ce1f215035ad2dcd3f7f5b15a7008 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Sanchez Date: Tue, 10 Dec 2024 11:49:29 -0300 Subject: [PATCH 2/2] Update CHANGELOG. --- CHANGELOG.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 839b4bd9..2240b5e4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,11 @@ Version History =============== +v7.1.7 +------ + +* Make channels layer group expiry parameter configurable through an environment variable. ``_ + v7.1.6 ------