Merge pull request #96 from dannon/release_15.03

[STABLE] Connection pool disposal fixes for all 3 apps
This commit is contained in:
John Chilton
2015-04-08 15:09:21 -05:00
3 changed files with 9 additions and 8 deletions
+4 -4
View File
@@ -106,13 +106,13 @@ def app_factory( global_conf, **kwargs ):
pack_scripts()
# Close any pooled database connections before forking
try:
galaxy.model.mapping.metadata.engine.connection_provider._pool.dispose()
galaxy.model.mapping.metadata.bind.dispose()
except:
pass
log.exception("Unable to dispose of pooled galaxy model database connections.")
try:
galaxy.model.tool_shed_install.mapping.metadata.engine.connection_provider._pool.dispose()
galaxy.model.tool_shed_install.mapping.metadata.bind.dispose()
except:
pass
log.exception("Unable to dispose of pooled toolshed install model database connections.")
if not app.config.is_uwsgi:
postfork_setup()
+3 -2
View File
@@ -70,12 +70,13 @@ def app_factory( global_conf, **kwargs ):
webapp = wrap_in_static( webapp, global_conf, **kwargs )
# Close any pooled database connections before forking
try:
galaxy.model.mapping.metadata.engine.connection_provider._pool.dispose()
galaxy.model.mapping.metadata.bind.dispose()
except:
pass
log.exception("Unable to dispose of pooled galaxy model database connections.")
# Return
return webapp
def wrap_in_middleware( app, global_conf, **local_conf ):
"""Based on the configuration wrap `app` in a set of common and useful middleware."""
# Merge the global and local configurations
+2 -2
View File
@@ -153,9 +153,9 @@ def app_factory( global_conf, **kwargs ):
webapp = wrap_in_static( webapp, global_conf, **kwargs )
# Close any pooled database connections before forking
try:
galaxy.webapps.tool_shed.model.mapping.metadata.engine.connection_provider._pool.dispose()
galaxy.webapps.tool_shed.model.mapping.metadata.bind.dispose()
except:
pass
log.exception("Unable to dispose of pooled tool_shed model database connections.")
# Return
return webapp