Skip to content
This repository was archived by the owner on Apr 23, 2022. It is now read-only.

Commit 29d704f

Browse files
committed
turbogears: Close db_session for each request
1 parent 9e4bd9a commit 29d704f

File tree

1 file changed

+7
-1
lines changed
  • frameworks/Python/turbogears

1 file changed

+7
-1
lines changed

frameworks/Python/turbogears/app.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,11 @@ def fortune(self):
8484
config = AppConfig(minimal=True, root_controller=RootController())
8585
config.renderers.append("jinja")
8686

87-
app = config.make_wsgi_app()
87+
tg_app = config.make_wsgi_app()
8888

89+
90+
def app(env, start):
91+
try:
92+
return tg_app(env, start)
93+
finally:
94+
db_session.close()

0 commit comments

Comments
 (0)