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:
|
||||||
writer.close()
|
if writer is not None:
|
||||||
|
writer.close()
|
||||||
|
|
|
@ -243,7 +243,8 @@ 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.
|
||||||
"""
|
"""
|
||||||
self.__writer.close()
|
if self.__writer is not None:
|
||||||
|
self.__writer.close()
|
||||||
self.__reader = None
|
self.__reader = None
|
||||||
self.__writer = None
|
self.__writer = None
|
||||||
self.__target_names = None
|
self.__target_names = None
|
||||||
|
|
Loading…
Reference in New Issue