mirror of
				https://github.com/mewtek/i2ME-Legacy.git
				synced 2025-06-10 05:30:00 -05:00 
			
		
		
		
	Alerts collector task
This commit is contained in:
		| @@ -1,11 +1,16 @@ | |||||||
| import asyncio | import asyncio | ||||||
| from recordGenerators import CurrentObservations,HourlyForecast,DailyForecast | from recordGenerators import Alerts,CurrentObservations,HourlyForecast,DailyForecast | ||||||
|  |  | ||||||
|  |  | ||||||
| """ This houses the tasks needed to update the data records concurrently  | """ 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. |     I have no idea if this is a messy way to do things, but it will be worked upon if it is. | ||||||
| """ | """ | ||||||
|  |  | ||||||
|  | async def alertsTask(): | ||||||
|  |     while True: | ||||||
|  |         await Alerts.makeRecord() | ||||||
|  |         await asyncio.sleep(60) | ||||||
|  |  | ||||||
| async def coTask(): | async def coTask(): | ||||||
|     while True: |     while True: | ||||||
|         await CurrentObservations.makeDataFile() |         await CurrentObservations.makeDataFile() | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.py
									
									
									
									
									
								
							| @@ -37,11 +37,13 @@ l.info("Starting i2RecordCollector") | |||||||
| l.info("Developed by mewtek32, Floppaa, Goldblaze, and needlenose") | l.info("Developed by mewtek32, Floppaa, Goldblaze, and needlenose") | ||||||
|  |  | ||||||
| async def main(): | async def main(): | ||||||
|  |     alertsTask = asyncio.create_task(RecordTasks.alertsTask()) | ||||||
|     coTask = asyncio.create_task(RecordTasks.coTask()) |     coTask = asyncio.create_task(RecordTasks.coTask()) | ||||||
|     hfTask = asyncio.create_task(RecordTasks.hfTask()) |     hfTask = asyncio.create_task(RecordTasks.hfTask()) | ||||||
|     dfTask = asyncio.create_task(RecordTasks.dfTask()) |     dfTask = asyncio.create_task(RecordTasks.dfTask()) | ||||||
|  |  | ||||||
|     # In theory, these should all run concurrently without problems |     # In theory, these should all run concurrently without problems | ||||||
|  |     await alertsTask | ||||||
|     await coTask |     await coTask | ||||||
|     await hfTask |     await hfTask | ||||||
|     await dfTask |     await dfTask | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user