手动刷新失败密钥缓存
()
| 418 | |
| 419 | @app.post("/refresh_cache") |
| 420 | async def refresh_cache(): |
| 421 | """手动刷新失败密钥缓存""" |
| 422 | logger.info("收到手动刷新缓存请求") |
| 423 | try: |
| 424 | update_failed_keys_cache() |
| 425 | return {"message": "缓存刷新成功", "timestamp": datetime.now().isoformat()} |
| 426 | except Exception as e: |
| 427 | logger.error(f"手动刷新缓存失败: {str(e)}") |
| 428 | raise HTTPException(status_code=500, detail=f"刷新缓存失败: {str(e)}") |
| 429 | |
| 430 | if __name__ == "__main__": |
| 431 | import uvicorn |
nothing calls this directly
no test coverage detected