Skip to content

Commit

Permalink
Use config_filename throughout ToolCache
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Mar 9, 2017
1 parent 0d80b88 commit 7b37566
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/galaxy/tools/toolbox/cache.py
Expand Up @@ -17,9 +17,9 @@ def __init__(self):
def cleanup(self):
"""Remove uninstalled tools from tool cache if they are not on disk anymore or if their content has changed."""
paths_to_cleanup = {path: tool.all_ids for path, tool in self._tools_by_path.items() if not os.path.exists(path) or md5_hash_file(path) != self._hash_by_tool_paths[path]}
for path, tool_ids in paths_to_cleanup.items():
del self._hash_by_tool_paths[path]
del self._tools_by_path[path]
for config_filename, tool_ids in paths_to_cleanup.items():
del self._hash_by_tool_paths[config_filename]
del self._tools_by_path[config_filename]
for tool_id in tool_ids:
if tool_id in self._tool_paths_by_id:
del self._tool_paths_by_id[tool_id]
Expand All @@ -32,7 +32,7 @@ def get_tool(self, config_filename):
def expire_tool(self, tool_id):
if tool_id in self._tool_paths_by_id:
config_filename = self._tool_paths_by_id[tool_id]
del self._hash_by_tool_paths[path]
del self._hash_by_tool_paths[config_filename]
del self._tool_paths_by_id[tool_id]
del self._tools_by_path[config_filename]

Expand Down

0 comments on commit 7b37566

Please sign in to comment.