From a657d8f2067f6e1b999bd8522ed1731ab9122505 Mon Sep 17 00:00:00 2001 From: Eugene Shershen Date: Thu, 17 Oct 2024 22:57:27 +0300 Subject: [PATCH] fixes mypy --- fastapi_async_sqlalchemy/middleware.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastapi_async_sqlalchemy/middleware.py b/fastapi_async_sqlalchemy/middleware.py index f70a49e..06f3268 100644 --- a/fastapi_async_sqlalchemy/middleware.py +++ b/fastapi_async_sqlalchemy/middleware.py @@ -67,8 +67,7 @@ def session(self) -> AsyncSession: multi_sessions = _multi_sessions_ctx.get() if multi_sessions: - """If multi_sessions is True, we are in a context where multiple sessions are allowed. - In this case, we need to create a new session for each task. + """ In this case, we need to create a new session for each task. We also need to commit the session on exit if commit_on_exit is True. This is useful when we need to run multiple queries in parallel. For example, when we need to run multiple queries in parallel in a route handler.