feat: caché de contenido de fuentes — reutiliza URLs scrapeadas en últimos 7 días
Build & Deploy ResearchOwl / build-and-push (push) Successful in 6s
Build & Deploy ResearchOwl / build-and-push (push) Successful in 6s
This commit is contained in:
@@ -414,6 +414,23 @@ class ExhaustiveScraper:
|
||||
source_id = source["id"]
|
||||
|
||||
try:
|
||||
try:
|
||||
cached = await self.db.get_cached_content(url)
|
||||
except Exception as cache_err:
|
||||
logger.warning("Cache lookup failed", url=url, error=str(cache_err))
|
||||
cached = None
|
||||
|
||||
if cached:
|
||||
logger.debug("Cache hit", url=url)
|
||||
await self.db.save_source_content(source_id, cached)
|
||||
await self.db.update_source(
|
||||
source_id,
|
||||
status="scraped",
|
||||
scraped_at=time.time(),
|
||||
word_count=len(cached.split()),
|
||||
)
|
||||
return 0
|
||||
|
||||
if source_type == "youtube":
|
||||
content, title = await fetch_with_retry(
|
||||
lambda: self._extract_youtube(url), url
|
||||
|
||||
Reference in New Issue
Block a user