Stores generated wiki data (structure and pages) to the server-side cache.
(request_data: WikiCacheRequest)
| 485 | |
| 486 | @app.post("/api/wiki_cache") |
| 487 | async def store_wiki_cache(request_data: WikiCacheRequest): |
| 488 | """ |
| 489 | Stores generated wiki data (structure and pages) to the server-side cache. |
| 490 | """ |
| 491 | # Language validation |
| 492 | supported_langs = configs["lang_config"]["supported_languages"] |
| 493 | |
| 494 | if not supported_langs.__contains__(request_data.language): |
| 495 | request_data.language = configs["lang_config"]["default"] |
| 496 | |
| 497 | logger.info(f"Attempting to save wiki cache for {request_data.repo.owner}/{request_data.repo.repo} ({request_data.repo.type}), lang: {request_data.language}") |
| 498 | success = await save_wiki_cache(request_data) |
| 499 | if success: |
| 500 | return {"message": "Wiki cache saved successfully"} |
| 501 | else: |
| 502 | raise HTTPException(status_code=500, detail="Failed to save wiki cache") |
| 503 | |
| 504 | @app.delete("/api/wiki_cache") |
| 505 | async def delete_wiki_cache( |
nothing calls this directly
no test coverage detected