INNER CODE UNIT · Python

sync_inventory

doganarif/fastapi-radar · example_app.py:353

async def sync_inventory(background_tasks: BackgroundTasks):
    """Synchronize inventory (sync task example)."""
    background_tasks.add_task(sync_inventory_task)
    return {"message": "Inventory sync started"}


@app.post("/test-failure")
async def test_task_failure(background_tasks: BackgroundTasks):
    """Test a failing background task."""
    background_tasks.add_task(failing_task)
    return {"message": "Failing task started (check background tasks page)"}


@app.get("/health")
async def health_check():
    """Health check endpoint (excluded from Radar by default)."""
    return {"status": "healthy"}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…