Fix pathing issue for article directory - use relative path ../scraper/articles

This commit is contained in:
Jarian Cottingham 2026-02-02 09:55:24 -06:00
parent ad2ef2a87b
commit b8228d8e07

View File

@ -25,7 +25,7 @@ class ArticleProcessor:
self.cache_manager = CacheManager(CACHE_FILE) self.cache_manager = CacheManager(CACHE_FILE)
self.batch_size = BATCH_SIZE self.batch_size = BATCH_SIZE
def find_unprocessed_articles(self, scraper_dir: str = "/app/articles") -> List[Tuple[str, str]]: def find_unprocessed_articles(self, scraper_dir: str = "../scraper/articles") -> List[Tuple[str, str]]:
""" """
Find all unprocessed articles in the scraper directory. Find all unprocessed articles in the scraper directory.
@ -44,6 +44,7 @@ class ArticleProcessor:
logger.warning(f"Scraper directory does not exist: {scraper_dir}") logger.warning(f"Scraper directory does not exist: {scraper_dir}")
# Try alternative paths # Try alternative paths
alternative_paths = [ alternative_paths = [
"../scraper/articles",
"/scraper/articles", "/scraper/articles",
"/app/articles", "/app/articles",
"/articles" "/articles"
@ -149,7 +150,7 @@ class ArticleProcessor:
logger.info(f"Batch completed: {successful} successful, {failed} failed") logger.info(f"Batch completed: {successful} successful, {failed} failed")
return successful, failed return successful, failed
def process_all_articles(self, scraper_dir: str = "/scraper/articles") -> dict: def process_all_articles(self, scraper_dir: str = "../scraper/articles") -> dict:
""" """
Process all unprocessed articles in the scraper directory. Process all unprocessed articles in the scraper directory.
@ -212,7 +213,7 @@ class ArticleProcessor:
return stats return stats
def process_new_articles(self, scraper_dir: str = "/scraper/articles") -> dict: def process_new_articles(self, scraper_dir: str = "../scraper/articles") -> dict:
""" """
Process only new articles (those that haven't been processed yet). Process only new articles (those that haven't been processed yet).
This is designed for real-time processing of new articles. This is designed for real-time processing of new articles.
@ -223,4 +224,4 @@ class ArticleProcessor:
Returns: Returns:
Dictionary with processing statistics Dictionary with processing statistics
""" """
return self.process_all_articles(scraper_dir) return self.process_all_articles(scraper_dir)