Make each record update its own task

This commit is contained in:
April
2022-11-13 14:29:46 -07:00
parent 9cc4633e8f
commit 38dc9c005c
2 changed files with 33 additions and 54 deletions

22
RecordTasks.py Normal file
View File

@ -0,0 +1,22 @@
import asyncio
from recordGenerators import CurrentObservations,HourlyForecast,DailyForecast
""" This houses the tasks needed to update the data records concurrently
I have no idea if this is a messy way to do things, but it will be worked upon if it is.
"""
async def coTask():
while True:
await CurrentObservations.makeDataFile()
asyncio.sleep(5 * 60)
async def hfTask():
while True:
await HourlyForecast.makeDataFile()
asyncio.sleep(60 * 60)
async def dfTask():
while True:
await DailyForecast.makeDataFile()
asyncio.sleep(60 * 60)