Skip to content

Commit 4398249

Browse files
committed
adjust sentinel docs
1 parent 6e8c297 commit 4398249

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/source/configure/advanced_configurations.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ but for a simple configuration this will work:
112112

113113
.. code-block:: python
114114
115-
DJANGO_VALKEY_CONNECTION_FACTORY = "django_valkey.pool.SentinelConnectionFactory"
116-
117115
SENTINELS = [
118-
('sentinel-1', 26379),
116+
("127.0.0.1", 26379), # a list of (host name, port) tuples.
119117
]
120118
121119
CACHES = {
@@ -132,6 +130,9 @@ but for a simple configuration this will work:
132130
}
133131
}
134132
133+
*note*: the sentinel client uses the sentinel connection factory by default.
134+
you can change this behaviour by setting ``DJANGO_VALKEY_CONNECTION_FACTORY`` in your django settings or ``CONNECTION_FACTORY`` in your ``CACHES`` OPTIONS.
135+
135136
Use Shard client
136137
^^^^^^^^^^^^^^^^
137138

docs/source/configure/sentinel_configurations.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Sentinel configuration
44

55
a sentinel configuration has these parts:
66

7-
1. ``DJANGO_VALKEY_CONNECTION_FACTORY``: you can use the default ConnectionFactory or SentinelConnectionFactory
7+
1. ``DJANGO_VALKEY_CONNECTION_FACTORY``: you can use the ConnectionFactory or SentinelConnectionFactory. the sentinel client uses SentinelConnectionFactory by default.
88
SentinelConnectionFactory inherits from ConnectionFactory but adds checks to see if configuration is correct, also adds features to make configuration more robust.
99

1010
2. ``CACHES["default"]["OPTIONS"]["CONNECTION_FACTORY"]``: does what the above option does, but only in the scope of the cache server it was defined in.
@@ -25,6 +25,7 @@ the below code is a bit long but comprehensive example of different ways to conf
2525
2626
DJANGO_VALKEY_CONNECTION_FACTORY = "django_valkey.pool.SentinelConnectionFactory"
2727
28+
# SENTINELS is a list of (host name, port) tuples
2829
# These sentinels are shared between all the examples, and are passed
2930
# directly to valkey Sentinel. These can also be defined inline.
3031
SENTINELS = [

0 commit comments

Comments
 (0)