Stop removing changes from the cache
The zuul trigger ends up querying a large number of changes on each merge, most of which are not in any pipelines. To avoid needlessly querying gerrit for data that do not change, keep all changes that Zuul ever sees in the cache. We could consider removing changes that are both not in pipelines and closed (ie, keep all open changes), but we still end up querying a number of merged changes each time due to Zuul following dependencies of open changes. Change-Id: Ie78df9aa43ec5ac35bdea79dcdafdfdd41d51d5b
This commit is contained in:
parent
f8ff9937b5
commit
e2259ea455
|
@ -946,9 +946,6 @@ class ZuulTestCase(testtools.TestCase):
|
|||
self.config.read(os.path.join(FIXTURE_DIR, "zuul.conf"))
|
||||
|
||||
def assertFinalState(self):
|
||||
# Make sure that the change cache is cleared
|
||||
self.assertEqual(len(self.gerrit._change_cache.keys()), 0,
|
||||
"Change cache should have been cleared")
|
||||
# Make sure that git.Repo objects have been garbage collected.
|
||||
repos = []
|
||||
gc.collect()
|
||||
|
|
|
@ -279,13 +279,9 @@ class Gerrit(object):
|
|||
def maintainCache(self, relevant):
|
||||
# This lets the user supply a list of change objects that are
|
||||
# still in use. Anything in our cache that isn't in the supplied
|
||||
# list should be same to remove from the cache.
|
||||
remove = []
|
||||
for key, change in self._change_cache.items():
|
||||
if change not in relevant:
|
||||
remove.append(key)
|
||||
for key in remove:
|
||||
del self._change_cache[key]
|
||||
# list should be safe to remove from the cache.
|
||||
# TODO(jeblair): consider removing this feature
|
||||
return
|
||||
|
||||
def postConfig(self):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue