Skip to content

Commit

Permalink
Add a 10 second timeout to loading data URLs for Tool Data Tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
blankenberg committed Mar 2, 2015
1 parent 0c94f04 commit 6e17bf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/tools/data/__init__.py
Expand Up @@ -263,7 +263,7 @@ def __init__( self, config_element, tool_data_path, from_shed_config=False, file
self.data = []
self.configure_and_load( config_element, tool_data_path, from_shed_config)

def configure_and_load( self, config_element, tool_data_path, from_shed_config=False):
def configure_and_load( self, config_element, tool_data_path, from_shed_config=False, url_timeout=10 ):
"""
Configure and load table from an XML element.
"""
Expand All @@ -289,7 +289,7 @@ def configure_and_load( self, config_element, tool_data_path, from_shed_config=F
if filename:
tmp_file = NamedTemporaryFile( prefix='TTDT_URL_%s-' % self.name )
try:
tmp_file.write( urlopen( filename ).read() )
tmp_file.write( urlopen( filename, timeout=url_timeout ).read() )
except Exception, e:
log.error( 'Error loading Data Table URL "%s": %s', filename, e )
continue
Expand Down

0 comments on commit 6e17bf4

Please sign in to comment.