From 0285fd3679dce23d51e4a9455e10ece6b4ebb53a Mon Sep 17 00:00:00 2001 From: April Date: Thu, 13 Oct 2022 10:48:26 -0700 Subject: [PATCH] Fix the tasks in main.py not looping properly --- main.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index e0a3c08..bc268c4 100644 --- a/main.py +++ b/main.py @@ -11,18 +11,22 @@ Alerts: 5 minutes print("i2MessageEncoder-Python\nDeveloped by mewtek\nData record generators by Floppaa & Goldblaze") async def FiveMinUpdaters(): - CurrentObservations.makeDataFile() - await asyncio.sleep(300) + while True: + CurrentObservations.makeDataFile() + print("Sleeping for 5 minutes...") + await asyncio.sleep(300) async def HourUpdaters(): - DailyForecast.makeDataFile() - HourlyForecast.makeDataFile() - AirQuality.writeData() - PollenForecast.makeDataFile() - AirportDelays.writeData() - Breathing.makeDataFile() - await asyncio.sleep(3600) + while True: + DailyForecast.makeDataFile() + HourlyForecast.makeDataFile() + AirQuality.writeData() + PollenForecast.makeDataFile() + AirportDelays.writeData() + Breathing.makeDataFile() + print("Sleeping for an hour...") + await asyncio.sleep(3600) loop = asyncio.get_event_loop()