Fix the tasks in main.py not looping properly

This commit is contained in:
April 2022-10-13 10:48:26 -07:00
parent 63fe0a42e2
commit 0285fd3679
No known key found for this signature in database
GPG Key ID: 17A9A017FAA4DE5E

22
main.py
View File

@ -11,18 +11,22 @@ Alerts: 5 minutes
print("i2MessageEncoder-Python\nDeveloped by mewtek\nData record generators by Floppaa & Goldblaze") print("i2MessageEncoder-Python\nDeveloped by mewtek\nData record generators by Floppaa & Goldblaze")
async def FiveMinUpdaters(): async def FiveMinUpdaters():
CurrentObservations.makeDataFile() while True:
await asyncio.sleep(300) CurrentObservations.makeDataFile()
print("Sleeping for 5 minutes...")
await asyncio.sleep(300)
async def HourUpdaters(): async def HourUpdaters():
DailyForecast.makeDataFile() while True:
HourlyForecast.makeDataFile() DailyForecast.makeDataFile()
AirQuality.writeData() HourlyForecast.makeDataFile()
PollenForecast.makeDataFile() AirQuality.writeData()
AirportDelays.writeData() PollenForecast.makeDataFile()
Breathing.makeDataFile() AirportDelays.writeData()
await asyncio.sleep(3600) Breathing.makeDataFile()
print("Sleeping for an hour...")
await asyncio.sleep(3600)
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()