Test2 / app.py
Dunevhhhh's picture
Update app.py
f61e19a verified
raw
history blame contribute delete
629 Bytes
# app.py
import asyncio
import logging
from scheduler import NewsScheduler
from config import setup_logging, load_api_keys
# Logging-Konfiguration
setup_logging()
async def main():
try:
scheduler = NewsScheduler()
await scheduler.start()
while True:
await asyncio.sleep(3600) # Hauptloop für kontinuierlichen Betrieb
except KeyboardInterrupt:
logging.info("Bot wurde ordnungsgemäß beendet")
except Exception as e:
logging.error(f"Kritischer Fehler: {str(e)}")
finally:
await scheduler.shutdown()
if __name__ == "__main__":
asyncio.run(main())