Skip to content

Commit 5b16d47

Browse files
Eugene ShershenEugene Shershen
Eugene Shershen
authored and
Eugene Shershen
committed
refactoring
1 parent fb56776 commit 5b16d47

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

fastapi_async_sqlalchemy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__all__ = ["db", "SQLAlchemyMiddleware"]
44

5-
__version__ = "0.3.8"
5+
__version__ = "0.3.9"

fastapi_async_sqlalchemy/middleware.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from fastapi_async_sqlalchemy.exceptions import MissingSessionError, SessionNotInitialisedError
1313

14-
_Session: sessionmaker = None
14+
_Session: Optional[sessionmaker] = None
1515
_session: ContextVar[Optional[AsyncSession]] = ContextVar("_session", default=None)
1616

1717

@@ -42,8 +42,7 @@ def __init__(
4242

4343
async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):
4444
async with db(commit_on_exit=self.commit_on_exit):
45-
response = await call_next(request)
46-
return response
45+
return await call_next(request)
4746

4847

4948
class DBSessionMeta(type):

0 commit comments

Comments
 (0)