mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 07:05:36 +01:00
Close redis connection on shutdown
This commit is contained in:
@@ -43,6 +43,8 @@ def start_app() -> FastAPI:
|
|||||||
if database_.is_connected:
|
if database_.is_connected:
|
||||||
await database_.disconnect()
|
await database_.disconnect()
|
||||||
|
|
||||||
|
await app.state.redis.close()
|
||||||
|
|
||||||
Instrumentator(
|
Instrumentator(
|
||||||
should_ignore_untemplated=True,
|
should_ignore_untemplated=True,
|
||||||
excluded_handlers=["/docs", "/metrics", "/healthcheck"],
|
excluded_handlers=["/docs", "/metrics", "/healthcheck"],
|
||||||
|
|||||||
Reference in New Issue
Block a user