mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #96 from dannon/release_15.03
[STABLE] Connection pool disposal fixes for all 3 apps
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user