Prevent blocking when sending files to the i2

This commit is contained in:
April
2022-11-13 17:08:26 -07:00
parent 7727cdc23d
commit 2936a64cff
14 changed files with 40 additions and 27 deletions

View File

@ -88,6 +88,7 @@ def getTime(timestamp) -> str:
return str(time)
async def collect(radarType: str):
loop = asyncio.get_running_loop()
ts = await getValidTimestamps(radarType)
frames = await downloadRadarFrames(radarType, ts)
@ -99,4 +100,4 @@ async def collect(radarType: str):
if radarType == "satrad":
commands.append( '<MSG><Exec workRequest="storePriorityImage(FileExtension=.tiff,File={0},Location=US,ImageType=SatRad,IssueTime=' + getTime(ts[i]) + ')"/></MSG>' )
bit.sendFile([frames[i]], [commands[i]], 1, 0)
await loop.run_in_executor(bit.sendFile([frames[i]], [commands[i]], 1, 0))