Optimize memory consumption

This commit is contained in:
2020-03-09 18:10:35 +01:00
parent f9e0929a56
commit 5443b5769f

View File

@@ -117,6 +117,7 @@ class AIO(asyncio.Protocol):
with open(tmpfile, "wb") as f: with open(tmpfile, "wb") as f:
self.tmpfile = tmpfile self.tmpfile = tmpfile
f.write(self.data) f.write(self.data)
self.data = bytearray()
AIO.queue.put_nowait((AIO.config["uvscan_path"], tmpfile, self.process_uvscan_result)) AIO.queue.put_nowait((AIO.config["uvscan_path"], tmpfile, self.process_uvscan_result))
self.logger.info("{} queued uvscan of {}, queue size is {}".format(self.peer, tmpfile, AIO.queue.qsize())) self.logger.info("{} queued uvscan of {}, queue size is {}".format(self.peer, tmpfile, AIO.queue.qsize()))
break break