Run cleanup task (normally triggered by cron).
(data: CleanupRequest = CleanupRequest())
| 356 | |
| 357 | @app.post("/api/scheduled/cleanup") |
| 358 | async def run_cleanup(data: CleanupRequest = CleanupRequest()): |
| 359 | """Run cleanup task (normally triggered by cron).""" |
| 360 | try: |
| 361 | client = await get_dirty_client_async() |
| 362 | result = await client.execute_async( |
| 363 | SCHEDULED_WORKER, |
| 364 | "cleanup_old_files", |
| 365 | directory=data.directory, |
| 366 | max_age_days=data.max_age_days, |
| 367 | ) |
| 368 | return result |
| 369 | except DirtyError as e: |
| 370 | raise HTTPException(status_code=500, detail=str(e)) |
| 371 | |
| 372 | |
| 373 | @app.post("/api/scheduled/daily-report") |
nothing calls this directly
no test coverage detected