Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mpnowacki-reef committed Jan 25, 2024
1 parent 5948317 commit 73205a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion channels_redis/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ def __init__(
# a message back into the main queue before its cleanup has completed
self.receive_clean_locks = ChannelLock()

def _packing_kwargs(message):
"""
kwargs passed to msgpack.packb
"""
return {'use_bin_type': True}

def create_pool(self, index):
return create_pool(self.hosts[index])

Expand Down Expand Up @@ -656,7 +662,7 @@ def serialize(self, message):
"""
Serializes message to a byte string.
"""
value = msgpack.packb(message, use_bin_type=True)
value = msgpack.packb(message, **self._packing_kwargs(message))
if self.crypter:
value = self.crypter.encrypt(value)

Expand Down

0 comments on commit 73205a4

Please sign in to comment.