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