Skip to content

Commit

Permalink
feat(django): publish the plugin reload message to a separate redis
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Nov 15, 2023
1 parent 7f851ce commit 9781c5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion posthog/plugins/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

def reload_plugins_on_workers():
logger.info("Reloading plugins on workers")
get_client().publish(settings.PLUGINS_RELOAD_PUBSUB_CHANNEL, "reload!")
get_client(settings.REDIS_INGESTION_URL).publish(settings.PLUGINS_RELOAD_PUBSUB_CHANNEL, "reload!")
6 changes: 6 additions & 0 deletions posthog/settings/data_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ def _parse_kafka_hosts(hosts_string: str) -> List[str]:
# so that we don't have to worry about changing config.
REDIS_READER_URL = os.getenv("REDIS_READER_URL", None)

# Ingestion is now using a separate Redis cluster for better resource isolation.
# Django and plugin-server currently communicate via a Redis pubsub channel for
# the "reload-plugins" message, send when plugin configs change.
# We should move away to a different communication channel and remove this.
REDIS_INGESTION_URL = os.getenv("REDIS_INGESTION_URL", REDIS_URL)

CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
Expand Down

0 comments on commit 9781c5f

Please sign in to comment.