django / channels_redis

Redis channel layer backend for Django Channels
BSD 3-Clause "New" or "Revised" License
601 stars 197 forks source link

fix: django conf should not be modified #341

Closed techblack closed 1 year ago

techblack commented 2 years ago

This place is passed by reference, which will cause the configuration to change, and other applications will read the wrong configuration

before this pr: from django.conf import settings getattr(settings, "CHANNEL_LAYERS", {}) result

{'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': {'hosts': [{'sentinels': [('a.b.c.d', 6379)], 'master_name': 'redis-master', 'db': 0, 'password': 'password', 'sentinel_kwargs': {'password': 'password'}}]}}}

after channel connection result

{'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': {'hosts': [{'db': 0, 'password': 'password'}]}}}

krisatverbidio commented 2 years ago

Also affected by this bug. Would love to see this get merged in soon.

carltongibson commented 2 years ago

I'm planning releases for the new year period. This is on the agenda for that.

carltongibson commented 1 year ago

Resolved in #352. Thanks.