feat: overhaul UI styling, improve templates, enhance services and tests
This commit is contained in:
@@ -191,7 +191,11 @@ async def summarize_one(
|
||||
|
||||
# 跳过 permanent_failure(除非 force)
|
||||
if status.status == "permanent_failure" and not force:
|
||||
return {"arxiv_id": arxiv_id, "status": "skipped", "reason": "permanent_failure"}
|
||||
return {
|
||||
"arxiv_id": arxiv_id,
|
||||
"status": "skipped",
|
||||
"reason": "permanent_failure",
|
||||
}
|
||||
|
||||
if semaphore:
|
||||
await semaphore.acquire()
|
||||
@@ -270,7 +274,9 @@ async def _do_summarize_one(db: Session, paper: Paper) -> dict:
|
||||
}
|
||||
index_paper(arxiv_id, texts_dict)
|
||||
except Exception:
|
||||
logger.warning("Failed to index paper %s in ChromaDB", arxiv_id, exc_info=True)
|
||||
logger.warning(
|
||||
"Failed to index paper %s in ChromaDB", arxiv_id, exc_info=True
|
||||
)
|
||||
|
||||
logger.info("Summarize done: %s quality=%s", arxiv_id, quality)
|
||||
return {"arxiv_id": arxiv_id, "status": "done", "quality": quality}
|
||||
@@ -430,7 +436,13 @@ async def summarize_batch(
|
||||
log_entry.papers_new = 0
|
||||
log_entry.completed_at = datetime.now(timezone.utc)
|
||||
release_lock(db, lock)
|
||||
return {"status": "success", "done": 0, "failed": 0, "skipped": 0, "total": 0}
|
||||
return {
|
||||
"status": "success",
|
||||
"done": 0,
|
||||
"failed": 0,
|
||||
"skipped": 0,
|
||||
"total": 0,
|
||||
}
|
||||
|
||||
# 并发控制
|
||||
semaphore = asyncio.Semaphore(settings.SUMMARY_CONCURRENCY)
|
||||
@@ -482,7 +494,10 @@ async def summarize_batch(
|
||||
|
||||
logger.info(
|
||||
"Summarize batch done: total=%d done=%d failed=%d skipped=%d",
|
||||
total, done, failed, skipped,
|
||||
total,
|
||||
done,
|
||||
failed,
|
||||
skipped,
|
||||
)
|
||||
return {
|
||||
"status": "success" if failed == 0 else "partial",
|
||||
|
||||
Reference in New Issue
Block a user