File size: 629 Bytes
f61e19a c7ed923 f61e19a c7ed923 f61e19a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# 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()) |