Skip to content

Commit b24d487

Browse files
committed
Give reason for disconnection
1 parent ebe50e7 commit b24d487

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cms/io/rpc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def finalize(self, reason=""):
190190
for handler in self._on_disconnect_handlers:
191191
gevent.spawn(handler)
192192

193-
def disconnect(self):
193+
def disconnect(self, reason="Disconnection requested."):
194194
"""Gracefully close the connection.
195195
196196
return (bool): True if the service was connected.
@@ -206,7 +206,7 @@ def disconnect(self):
206206
logger.warning("Couldn't disconnect from %s: %s.",
207207
self._repr_remote(), error)
208208
finally:
209-
self.finalize("Disconnection requested.")
209+
self.finalize(reason=reason)
210210
return True
211211

212212
def _read(self):
@@ -502,9 +502,9 @@ def connect(self):
502502
raise RuntimeError("Already (auto-re)connecting")
503503
self._loop = gevent.spawn(self._run)
504504

505-
def disconnect(self):
505+
def disconnect(self, reason="Disconnection requested."):
506506
"""See RemoteServiceBase.disconnect."""
507-
if super(RemoteServiceClient, self).disconnect():
507+
if super(RemoteServiceClient, self).disconnect(reason=reason):
508508
self._loop.kill()
509509
self._loop = None
510510

0 commit comments

Comments
 (0)