mirror of https://github.com/m-labs/artiq.git
parent
44910efd0a
commit
223b984385
|
@ -168,6 +168,7 @@ class LogForwarder(logging.Handler, TaskObject):
|
||||||
self._queue.put_nowait(record.source + ":" + self.format(record))
|
self._queue.put_nowait(record.source + ":" + self.format(record))
|
||||||
|
|
||||||
async def _do(self):
|
async def _do(self):
|
||||||
|
reader = writer = None
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
reader, writer = await asyncio.open_connection(self.host,
|
reader, writer = await asyncio.open_connection(self.host,
|
||||||
|
@ -182,4 +183,5 @@ class LogForwarder(logging.Handler, TaskObject):
|
||||||
except:
|
except:
|
||||||
await asyncio.sleep(self.reconnect_timer)
|
await asyncio.sleep(self.reconnect_timer)
|
||||||
finally:
|
finally:
|
||||||
|
if writer is not None:
|
||||||
writer.close()
|
writer.close()
|
||||||
|
|
|
@ -243,6 +243,7 @@ class AsyncioClient:
|
||||||
|
|
||||||
No further method calls should be done after this method is called.
|
No further method calls should be done after this method is called.
|
||||||
"""
|
"""
|
||||||
|
if self.__writer is not None:
|
||||||
self.__writer.close()
|
self.__writer.close()
|
||||||
self.__reader = None
|
self.__reader = None
|
||||||
self.__writer = None
|
self.__writer = None
|
||||||
|
|
Loading…
Reference in New Issue