Cache built-in game parsing to avoid recomputation per request
This commit is contained in:
parent
0a7cdc0f15
commit
46955f0644
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "chess-pressure"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
description = "Chess pressure heatmap visualization"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
import uvicorn
|
||||
@ -39,6 +40,7 @@ def list_games():
|
||||
|
||||
|
||||
@app.get("/api/games/{game_id}")
|
||||
@lru_cache(maxsize=16)
|
||||
def load_game(game_id: str):
|
||||
pgn = get_game_pgn(game_id)
|
||||
if pgn is None:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user