Use async sleep, increase chunk size

This commit is contained in:
Antonín Skala
2022-08-22 12:33:59 +02:00
committed by Markus
parent ccdba4ed8a
commit 94a531c464

View File

@ -55,7 +55,7 @@ async def binary_send(websocket, fw_file):
with open(fw_file, "rb") as binaryfile: with open(fw_file, "rb") as binaryfile:
while True: while True:
chunk = binaryfile.read(2048) chunk = binaryfile.read(4096)
if not chunk: if not chunk:
break break
try: try:
@ -63,7 +63,7 @@ async def binary_send(websocket, fw_file):
except Exception as exception: except Exception as exception:
Logger.exception(exception) Logger.exception(exception)
return False return False
time.sleep(0.2) asyncio.sleep(0.2)
def version_checker(name, vdev, vapp): def version_checker(name, vdev, vapp):