Skip to content

Commit

Permalink
Merge pull request #296 from lsst-ts/tickets/DM-43551
Browse files Browse the repository at this point in the history
Make channels layer group expiry parameter configurable through an environment variable.
  • Loading branch information
sebastian-aranda authored Dec 13, 2024
2 parents b65079b + a149fc2 commit 3cb6078
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Version History
===============

v7.1.7
------

* Make channels layer group expiry parameter configurable through an environment variable. `<https://github.com/lsst-ts/LOVE-manager/pull/296>`_

v7.1.6
------

Expand Down
12 changes: 3 additions & 9 deletions manager/manager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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": {
Expand All @@ -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,
},
},
}
Expand Down

0 comments on commit 3cb6078

Please sign in to comment.