mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 20:22:53 -06:00
ammend redis conn check to acccount for sentinel
This commit is contained in:
parent
0a8d39cfe4
commit
03a7f6bbda
@ -13,6 +13,16 @@ class ExtrasConfig(AppConfig):
|
|||||||
|
|
||||||
# Check that we can connect to the configured Redis database.
|
# Check that we can connect to the configured Redis database.
|
||||||
try:
|
try:
|
||||||
|
if settings.WEBHOOKS_REDIS_USING_SENTINEL:
|
||||||
|
sentinel = redis.sentinel.Sentinel(
|
||||||
|
settings.WEBHOOKS_REDIS_SENTINELS,
|
||||||
|
socket_timeout=settings.WEBHOOKS_REDIS_DEFAULT_TIMEOUT
|
||||||
|
)
|
||||||
|
rs = sentinel.master_for(
|
||||||
|
settings.WEBHOOKS_REDIS_SENTINEL_SERVICE,
|
||||||
|
socket_timeout=settings.WEBHOOKS_REDIS_DEFAULT_TIMEOUT
|
||||||
|
)
|
||||||
|
else:
|
||||||
rs = redis.Redis(
|
rs = redis.Redis(
|
||||||
host=settings.WEBHOOKS_REDIS_HOST,
|
host=settings.WEBHOOKS_REDIS_HOST,
|
||||||
port=settings.WEBHOOKS_REDIS_PORT,
|
port=settings.WEBHOOKS_REDIS_PORT,
|
||||||
|
Loading…
Reference in New Issue
Block a user