Skip to content

Commit 07e8d44

Browse files
committed
feat: configure redis host and port settings for watcher
1 parent 41b20bf commit 07e8d44

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

openedx_authz/engine/watcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import logging
1515

16+
from django.conf import settings
1617
from redis_watcher import WatcherOptions, new_watcher
1718

1819
logger = logging.getLogger(__name__)
@@ -39,8 +40,8 @@ def create_watcher():
3940
The configured watcher instance
4041
"""
4142
watcher_options = WatcherOptions()
42-
watcher_options.host = "redis"
43-
watcher_options.port = 6379
43+
watcher_options.host = settings.REDIS_HOST
44+
watcher_options.port = settings.REDIS_PORT
4445
watcher_options.optional_update_callback = callback_function
4546

4647
try:

openedx_authz/settings/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ def plugin_settings(settings):
2323

2424
# Add Casbin configuration
2525
settings.CASBIN_MODEL = os.path.join(ROOT_DIRECTORY, "engine", "config", "model.conf")
26+
# Redis host and port are temporarily loaded here for the MVP
27+
settings.REDIS_HOST = "redis"
28+
settings.REDIS_PORT = 6379

0 commit comments

Comments
 (0)