Files
backend/tmp_refresh_all_citations.py
T
34047007@qq.com a6cd99a4ca
CI / backend (push) Canceled after 0s
CI / frontend (push) Canceled after 0s
feat: initial commit - oncology literature search platform
OncoLit: a multi-tenant oncology literature search, feed, and
collaboration platform. Built with FastAPI + Vue 3 + PostgreSQL.
Includes PubMed pipeline, drug approvals, AI summaries, and
systematic review tools.
2026-07-27 07:59:18 +08:00

20 lines
718 B
Python

"""Run FULL citation refresh (no limit = all 148k records)"""
import asyncio
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import sessionmaker
from app.services.pubmed_api import update_citation_counts
DATABASE_URL = 'postgresql+asyncpg://scilit:scilit_prod_2026@postgres:5432/scilit'
async def main():
engine = create_async_engine(DATABASE_URL, pool_size=4)
async_session = sessionmaker(engine, class_=AsyncSession)
async with async_session() as db:
result = await update_citation_counts(db, limit=0)
print(f"Updated: {result['updated']}, Total: {result['total']}, Errors: {result['errors']}")
await engine.dispose()
asyncio.run(main())