This commit is contained in:
2025-11-12 23:30:46 +01:00
parent 029befba96
commit 433a16ee0e

View File

@@ -13,7 +13,7 @@ import sys
# Add current directory to path # Add current directory to path
sys.path.insert(0, str(Path(__file__).parent)) sys.path.insert(0, str(Path(__file__).parent))
from sender_service import send_newsletter, get_latest_articles, Config from sender_service import send_newsletter, get_latest_articles_by_categories, Config
# Berlin timezone # Berlin timezone
BERLIN_TZ = pytz.timezone('Europe/Berlin') BERLIN_TZ = pytz.timezone('Europe/Berlin')
@@ -28,7 +28,7 @@ def check_crawler_finished():
""" """
try: try:
# Check if we have articles from today # Check if we have articles from today
articles = get_latest_articles(max_articles=1, hours=2) articles = get_latest_articles_by_categories(categories=['general'], articles_per_category=1, hours=2)
if articles: if articles:
# Check if the most recent article was crawled recently (within last 2 hours) # Check if the most recent article was crawled recently (within last 2 hours)