Spaces:
Sleeping
Sleeping
File size: 855 Bytes
ef58e1a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | from fastapi import APIRouter, BackgroundTasks
from app.scheduler.cron import run_daily_tech_digest_pipeline
router = APIRouter()
@router.post("")
async def trigger_manual_scrape(background_tasks: BackgroundTasks):
"""
Manually triggers the tech update scraping, LangChain AI summarization, ChromaDB indexing, and FCM push notification pipeline.
Runs asynchronously in background tasks.
"""
background_tasks.add_task(run_daily_tech_digest_pipeline)
return {
"status": "triggered",
"message": "Daily tech update pipeline started in background. Check /api/v1/digests/latest shortly."
}
@router.post("/sync")
async def trigger_manual_scrape_sync():
"""
Synchronously triggers the pipeline and returns the result immediately.
"""
result = await run_daily_tech_digest_pipeline()
return result
|