diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-11-06 15:55:19 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2015-02-18 10:31:43 +0000 |
commit | cc91b8cec9f75ec5e3220878d496b612d97b4681 (patch) | |
tree | cba25827a29411cc07cfabe420178c6fde08c27e /morphlib/plugins/list_artifacts_plugin.py | |
parent | eac9226720eee7cdd223d789550e35b103870cc0 (diff) | |
download | morph-cc91b8cec9f75ec5e3220878d496b612d97b4681.tar.gz |
Add an LRU cache for resolved tree refs
This uses the PyLRU module, from:
<https://pypi.python.org/pypi/pylru/1.0.6>.
Python 3.2 and newer provide a built-in LRU cache, but this is
specifically for in-memory use. See <http://bugs.python.org/issue17528>.
Git commits are immutable, so caching information about their contents
is fairly easy and trouble-free. There's no danger of the cache becoming
stale.
Diffstat (limited to 'morphlib/plugins/list_artifacts_plugin.py')
-rw-r--r-- | morphlib/plugins/list_artifacts_plugin.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/morphlib/plugins/list_artifacts_plugin.py b/morphlib/plugins/list_artifacts_plugin.py index 6944cff4..53056bad 100644 --- a/morphlib/plugins/list_artifacts_plugin.py +++ b/morphlib/plugins/list_artifacts_plugin.py @@ -1,4 +1,4 @@ -# Copyright (C) 2014 Codethink Limited +# Copyright (C) 2014-2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -86,6 +86,7 @@ class ListArtifactsPlugin(cliapp.Plugin): msg='Creating source pool for %s' % system_filename, chatty=True) source_pool = morphlib.sourceresolver.create_source_pool( self.lrc, self.rrc, repo, ref, system_filename, + cachedir=self.app.settings['cachedir'], update_repos = not self.app.settings['no-git-update'], status_cb=self.app.status) |