added amazon importer and logging smtp

This commit is contained in:
2026-03-20 16:22:38 +01:00
parent 9fdada5dbe
commit a4e39332c7
16 changed files with 2619 additions and 255 deletions
+12
View File
@@ -5,6 +5,7 @@ from apscheduler.triggers.interval import IntervalTrigger
from app.mail_processor import process_mailbox
from app.smb_processor import process_smb_share
from app.amazon_processor import process_amazon
logger = logging.getLogger(__name__)
@@ -21,6 +22,7 @@ async def _run_processor():
return
_is_processing = True
try:
# Email and SMB first - these are fast and must not be blocked by Amazon
logger.info("Starte automatische Email-Verarbeitung...")
result = await process_mailbox()
logger.info(f"Email-Verarbeitung abgeschlossen: {result}")
@@ -28,6 +30,16 @@ async def _run_processor():
logger.info("Starte automatische SMB-Verarbeitung...")
smb_result = await process_smb_share()
logger.info(f"SMB-Verarbeitung abgeschlossen: {smb_result}")
# Amazon separately with timeout - must not block next scheduler runs
logger.info("Starte automatische Amazon-Verarbeitung...")
try:
amazon_result = await asyncio.wait_for(process_amazon(), timeout=300)
logger.info(f"Amazon-Verarbeitung abgeschlossen: {amazon_result}")
except asyncio.TimeoutError:
logger.error("Amazon-Verarbeitung nach 5 Minuten abgebrochen (Timeout)")
except Exception as e:
logger.error(f"Fehler bei Amazon-Verarbeitung: {e}")
except Exception as e:
logger.error(f"Fehler bei automatischer Verarbeitung: {e}")
finally: