From cbc1716dd503162c66906efa117409dc7aa89e8d Mon Sep 17 00:00:00 2001 From: Yarne Coppens Date: Mon, 21 Oct 2024 09:06:35 +0200 Subject: [PATCH] Added endpoint to clear stats cache --- src/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.py b/src/main.py index 9546af5..74480e2 100644 --- a/src/main.py +++ b/src/main.py @@ -101,6 +101,11 @@ def refresh(): return {"Status": "Already refreshing"} +@app.get('/delete_stat_cache') +def delete_stat_cache(): + statistic_creator.clear_cache() + return {"Status": "Statistics cache cleared"} + @app.get("/boardgame", response_model=boardgame_classes.BoardGamePublic) def get_boardgame_by_id(id: int, session: Session = Depends(get_session)): requested_boardgame = data_connection.get_boardgame(session, id)