File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,12 @@ def __init__(self, socket_read_size: int):
196
196
self ._reader = None
197
197
self .pubsub_push_handler_func = self .handle_pubsub_push_response
198
198
self .invalidation_push_handler_func = None
199
+ self ._hiredis_PushNotificationType = None
200
+
201
+ async def handle_pubsub_push_response (self , response ):
202
+ logger = getLogger ("push_response" )
203
+ logger .debug ("Push response: " + str (response ))
204
+ return response
199
205
200
206
def on_connect (self , connection ):
201
207
import hiredis
@@ -215,7 +221,7 @@ def on_connect(self, connection):
215
221
216
222
try :
217
223
self ._hiredis_PushNotificationType = getattr (
218
- hiredis , "PushNotificationType " , None
224
+ hiredis , "PushNotification " , None
219
225
)
220
226
except AttributeError :
221
227
# hiredis < 3.2
@@ -257,6 +263,7 @@ async def read_response(
257
263
response = self ._reader .gets (False )
258
264
else :
259
265
response = self ._reader .gets ()
266
+
260
267
while response is NOT_ENOUGH_DATA :
261
268
await self .read_from_socket ()
262
269
if disable_decoding :
Original file line number Diff line number Diff line change @@ -576,11 +576,7 @@ async def read_response(
576
576
read_timeout = timeout if timeout is not None else self .socket_timeout
577
577
host_error = self ._host_error ()
578
578
try :
579
- if (
580
- read_timeout is not None
581
- and self .protocol in ["3" , 3 ]
582
- and not HIREDIS_AVAILABLE
583
- ):
579
+ if read_timeout is not None and self .protocol in ["3" , 3 ]:
584
580
async with async_timeout (read_timeout ):
585
581
response = await self ._parser .read_response (
586
582
disable_decoding = disable_decoding , push_request = push_request
Original file line number Diff line number Diff line change 17
17
import redis .asyncio as redis
18
18
from redis .exceptions import ConnectionError
19
19
from redis .typing import EncodableT
20
- from redis .utils import HIREDIS_AVAILABLE
21
20
from tests .conftest import get_protocol_version , skip_if_server_version_lt
22
21
23
22
from .compat import aclosing , create_task , mock
You can’t perform that action at this time.
0 commit comments