Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Shershen authored and Eugene Shershen committed Oct 22, 2021
1 parent fb56776 commit 5b16d47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fastapi_async_sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__all__ = ["db", "SQLAlchemyMiddleware"]

__version__ = "0.3.8"
__version__ = "0.3.9"
5 changes: 2 additions & 3 deletions fastapi_async_sqlalchemy/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from fastapi_async_sqlalchemy.exceptions import MissingSessionError, SessionNotInitialisedError

_Session: sessionmaker = None
_Session: Optional[sessionmaker] = None
_session: ContextVar[Optional[AsyncSession]] = ContextVar("_session", default=None)


Expand Down Expand Up @@ -42,8 +42,7 @@ def __init__(

async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):
async with db(commit_on_exit=self.commit_on_exit):
response = await call_next(request)
return response
return await call_next(request)


class DBSessionMeta(type):
Expand Down

0 comments on commit 5b16d47

Please sign in to comment.