mirror of
https://github.com/mewtek/i2ME-Legacy.git
synced 2025-05-11 17:00:23 -05:00
Temporarily remove non-async tasks from main
This commit is contained in:
parent
c20b48b6d9
commit
b96bbad5d7
26
main.py
26
main.py
@ -38,28 +38,28 @@ l.info("Developed by mewtek32, Floppaa, Goldblaze, and needlenose")
|
|||||||
|
|
||||||
async def grabAlertsLoop():
|
async def grabAlertsLoop():
|
||||||
while True:
|
while True:
|
||||||
Alerts.makeRecord()
|
await Alerts.makeRecord()
|
||||||
await asyncio.sleep(60)
|
await asyncio.sleep(60)
|
||||||
|
|
||||||
async def FiveMinUpdaters():
|
async def FiveMinUpdaters():
|
||||||
while True:
|
while True:
|
||||||
CurrentObservations.makeDataFile()
|
await CurrentObservations.makeDataFile()
|
||||||
l.debug("Sleeping for 5 minutes...")
|
l.debug("Sleeping for 5 minutes...")
|
||||||
await asyncio.sleep(5 * 60)
|
await asyncio.sleep(5 * 60)
|
||||||
|
|
||||||
async def HourUpdaters():
|
async def HourUpdaters():
|
||||||
while True:
|
while True:
|
||||||
DailyForecast.makeDataFile()
|
await DailyForecast.makeDataFile()
|
||||||
HourlyForecast.makeDataFile()
|
await HourlyForecast.makeDataFile()
|
||||||
AirQuality.writeData()
|
# AirQuality.writeData()
|
||||||
PollenForecast.makeDataFile()
|
# PollenForecast.makeDataFile()
|
||||||
AirportDelays.writeData()
|
# AirportDelays.writeData()
|
||||||
Breathing.makeDataFile()
|
# Breathing.makeDataFile()
|
||||||
HeatingAndCooling.makeRecord()
|
# HeatingAndCooling.makeRecord()
|
||||||
WateringNeeds.makeRecord()
|
# WateringNeeds.makeRecord()
|
||||||
MosquitoActivity.makeRecord()
|
# MosquitoActivity.makeRecord()
|
||||||
AchesAndPains.makeRecord()
|
# AchesAndPains.makeRecord()
|
||||||
TideForecast.makeRecord()
|
# TideForecast.makeRecord()
|
||||||
l.debug("Sleeping for an hour...")
|
l.debug("Sleeping for an hour...")
|
||||||
await asyncio.sleep(60 * 60)
|
await asyncio.sleep(60 * 60)
|
||||||
|
|
||||||
|
@ -78,7 +78,10 @@ async def makeDataFile():
|
|||||||
files = []
|
files = []
|
||||||
commands = []
|
commands = []
|
||||||
|
|
||||||
# This causes blocking but there's not really much we can do about it :(
|
"""
|
||||||
|
TODO: This can be ran in a seperate thread using loop.run_in_executor() according to the python discord.
|
||||||
|
! This should probably be implemented ASAP.
|
||||||
|
"""
|
||||||
with open("./.temp/CurrentObservations.i2m", 'rb') as f_in:
|
with open("./.temp/CurrentObservations.i2m", 'rb') as f_in:
|
||||||
with gzip.open("./.temp/CurrentObservations.gz", 'wb') as f_out:
|
with gzip.open("./.temp/CurrentObservations.gz", 'wb') as f_out:
|
||||||
shutil.copyfileobj(f_in, f_out)
|
shutil.copyfileobj(f_in, f_out)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user