allow specifying more than one redis server URI in the REDIS_URI env var (#3368)

# What this PR does

Modifies the Django `settings/base.py` such that `REDIS_URI` can now be
a comma (or semicolon) separated list of URIs. From [Django
docs](https://docs.djangoproject.com/en/4.2/topics/cache/#:~:text=If%20you%20have%20multiple%20Redis%20servers%20set%20up%20in%20the%20replication%20mode%2C%20you%20can%20specify%20the%20servers%20either%20as%20a%20semicolon%20or%20comma%20delimited%20string%2C%20or%20as%20a%20list):

> If you have multiple Redis servers set up in the replication mode, you
can specify the servers either as a semicolon or comma delimited string,
or as a list. While using multiple servers, write operations are
performed on the first server (leader). Read operations are performed on
the other servers (replicas) chosen at random:
> ```python3
> CACHES = {
>     "default": {
>         "BACKEND": "django.core.cache.backends.redis.RedisCache",
>         "LOCATION": [
>             "redis://127.0.0.1:6379",  # leader
>             "redis://127.0.0.1:6378",  # read-replica 1
>             "redis://127.0.0.1:6377",  # read-replica 2
>         ],
>     }
> }
> ```

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated (N/A)
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
This commit is contained in:
Joey Orlando 2023-11-16 10:48:36 -05:00 committed by GitHub
parent 93badbd638
commit 5678d79927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View file

@ -7,17 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- Populate `users` field of the public Shift GET API with `rolling_users` from the type override created from web UI([#3303](https://github.com/grafana/oncall/pull/3303))
- Do not retry to update slack user group on every API error ([#3363](https://github.com/grafana/oncall/pull/3363))
- Allow specifying a comma-separated list of redis-servers to the `REDIS_URI` engine environment variable by @joeyorlando
([#3368](https://github.com/grafana/oncall/pull/3368))
### Fixed
- Fixed recurrency limit issue in the Rotation Modal ([#3358](https://github.com/grafana/oncall/pull/3358))
- Added dragging boundary constraints for Rotation Modal and show scroll for the users list ([#3365](https://github.com/grafana/oncall/pull/3365))
- Delete direct paging integration on team delete by @vadimkerr ([#3367](https://github.com/grafana/oncall/pull/3367))
### Added
- Populate `users` field of the public Shift GET API with `rolling_users` from the type override created from web UI([#3303](https://github.com/grafana/oncall/pull/3303))
- Do not retry to update slack user group on every API error ([#3363](https://github.com/grafana/oncall/pull/3363))
## v1.3.58 (2023-11-14)
### Added

View file

@ -1,13 +1,14 @@
import pytest
import yaml
from django.test import override_settings
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
@pytest.mark.django_db
@override_settings(DRF_SPECTACULAR_ENABLED=True)
def test_fetching_the_openapi_schema_works(settings, reload_urls):
settings.DRF_SPECTACULAR_ENABLED = True
reload_urls()
client = APIClient()

View file

@ -220,9 +220,7 @@ if REDIS_USE_SSL:
CACHES = {
"default": {
"BACKEND": "redis_cache.RedisCache",
"LOCATION": [
REDIS_URI,
],
"LOCATION": REDIS_URI,
"OPTIONS": {
"DB": REDIS_DATABASE,
"PARSER_CLASS": "redis.connection.HiredisParser",