@@ -129,8 +129,9 @@ def __del__(self):
129
129
def on_connect (self , connection ):
130
130
"Called when the socket connects"
131
131
self ._sock = connection ._sock
132
- timeout = connection .socket_timeout
133
- self ._buffer = SocketBuffer (self ._sock , self .socket_read_size , timeout )
132
+ self ._buffer = SocketBuffer (
133
+ self ._sock , self .socket_read_size , connection .socket_timeout
134
+ )
134
135
self .encoder = connection .encoder
135
136
136
137
def on_disconnect (self ):
@@ -201,19 +202,18 @@ def handle_push_response(self, response, **kwargs):
201
202
if msg_type in _INVALIDATION_MESSAGE and self .invalidation_push_handler_func :
202
203
return self .invalidation_push_handler_func (response )
203
204
if msg_type in _MOVING_MESSAGE and self .node_moving_push_handler_func :
204
- if msg_type in _MOVING_MESSAGE :
205
- host , port = response [2 ].decode ().split (":" )
206
- ttl = response [1 ]
207
- id = 1 # Hardcoded value for sync parser
208
- notification = NodeMovingEvent (id , host , port , ttl )
209
- return self .node_moving_push_handler_func (notification )
205
+ host , port = response [2 ].decode ().split (":" )
206
+ ttl = response [1 ]
207
+ id = 1 # Hardcoded value until the notification starts including the id
208
+ notification = NodeMovingEvent (id , host , port , ttl )
209
+ return self .node_moving_push_handler_func (notification )
210
210
if msg_type in _MAINTENANCE_MESSAGES and self .maintenance_push_handler_func :
211
211
if msg_type in _MIGRATING_MESSAGE :
212
212
ttl = response [1 ]
213
- id = 2 # Hardcoded value for sync parser
213
+ id = 2 # Hardcoded value until the notification starts including the id
214
214
notification = NodeMigratingEvent (id , ttl )
215
215
elif msg_type in _MIGRATED_MESSAGE :
216
- id = 3 # Hardcoded value for sync parser
216
+ id = 3 # Hardcoded value until the notification starts including the id
217
217
notification = NodeMigratedEvent (id )
218
218
else :
219
219
notification = None
0 commit comments