summaryrefslogtreecommitdiff
path: root/zuul/driver/gerrit
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-09-18 07:32:50 +0000
committerGerrit Code Review <review@openstack.org>2021-09-18 07:32:50 +0000
commitfc4324e4a4d19f5d2c6ce669241faacb8a1b2294 (patch)
tree5ee9d2dcd5152a4b66f16954d7d86243031cda52 /zuul/driver/gerrit
parent7af43971f25c594f0f95a976f8eeb4027c584b78 (diff)
parent0d635181f8d693c57b59d5144b997c0c8fe715ed (diff)
downloadzuul-fc4324e4a4d19f5d2c6ce669241faacb8a1b2294.tar.gz
Merge "Periodically maintain connection caches"
Diffstat (limited to 'zuul/driver/gerrit')
-rw-r--r--zuul/driver/gerrit/gerritconnection.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/zuul/driver/gerrit/gerritconnection.py b/zuul/driver/gerrit/gerritconnection.py
index 29a3eec79..ba7beb411 100644
--- a/zuul/driver/gerrit/gerritconnection.py
+++ b/zuul/driver/gerrit/gerritconnection.py
@@ -738,14 +738,8 @@ class GerritConnection(BaseConnection):
except KeyError:
pass
- 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 safe to remove from the cache.
- for change in self._change_cache:
- if change not in relevant:
- self._change_cache.delete(change.cache_stat.key)
- # TODO: remove entries older than X
+ def maintainCache(self, relevant, max_age):
+ self._change_cache.prune(relevant, max_age)
self._change_cache.cleanup()
def updateChangeAttributes(self, change, **attrs):