Skip to content

Commit

Permalink
Rebuild repo cache when deciding if repository should be created.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed May 1, 2017
1 parent 4c44338 commit 5069815
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -111,7 +111,6 @@ def activate_repository( self, repository ):
data_manager_relative_install_dir,
repository,
repository_tools_tups )
self.install_model.context.add( repository )
self.install_model.context.flush()
if repository.includes_datatypes:
if tool_path:
Expand Down
6 changes: 4 additions & 2 deletions lib/tool_shed/util/repository_util.py
Expand Up @@ -127,7 +127,7 @@ def create_or_update_tool_shed_repository( app, name, description, installed_cha
deleted = False
uninstalled = False
tool_shed_repository = \
get_installed_repository( app, tool_shed=tool_shed, name=name, owner=owner, installed_changeset_revision=installed_changeset_revision )
get_installed_repository( app, tool_shed=tool_shed, name=name, owner=owner, installed_changeset_revision=installed_changeset_revision, refresh=True )
if tool_shed_repository:
log.debug( "Updating an existing row for repository '%s' in the tool_shed_repository table, status set to '%s'." %
( str( name ), str( status ) ) )
Expand Down Expand Up @@ -371,13 +371,15 @@ def get_ids_of_tool_shed_repositories_being_installed( app, as_string=False ):
return installing_repository_ids


def get_installed_repository( app, tool_shed, name, owner, changeset_revision=None, installed_changeset_revision=None ):
def get_installed_repository( app, tool_shed, name, owner, changeset_revision=None, installed_changeset_revision=None, refresh=False ):
"""
Return a tool shed repository database record defined by the combination of a toolshed, repository name,
repository owner and either current or originally installed changeset_revision.
"""
tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed )
if hasattr(app, 'tool_shed_repository_cache'):
if refresh:
app.tool_shed_repository_cache.rebuild()
return app.tool_shed_repository_cache.get_installed_repository(tool_shed=tool_shed,
name=name,
owner=owner,
Expand Down

0 comments on commit 5069815

Please sign in to comment.