Skip to content

Commit 687f302

Browse files
committed
fix finally block
1 parent 5d3d731 commit 687f302

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

genotype_api/api/middleware.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from fastapi import Request
22
from starlette.middleware.base import BaseHTTPMiddleware
3-
from genotype_api.exceptions import GenotypeDBError
3+
44
from genotype_api.database.database import close_session
5+
from genotype_api.exceptions import GenotypeDBError
56

67

78
class DBSessionMiddleware(BaseHTTPMiddleware):
@@ -13,6 +14,6 @@ async def dispatch(self, request: Request, call_next):
1314
response = await call_next(request)
1415
except Exception:
1516
raise GenotypeDBError
16-
finally
17+
finally:
1718
close_session()
1819
return response

0 commit comments

Comments
 (0)