diff options
author | Zuul <zuul@review.opendev.org> | 2021-09-18 07:32:50 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2021-09-18 07:32:50 +0000 |
commit | fc4324e4a4d19f5d2c6ce669241faacb8a1b2294 (patch) | |
tree | 5ee9d2dcd5152a4b66f16954d7d86243031cda52 /zuul/driver/gerrit | |
parent | 7af43971f25c594f0f95a976f8eeb4027c584b78 (diff) | |
parent | 0d635181f8d693c57b59d5144b997c0c8fe715ed (diff) | |
download | zuul-fc4324e4a4d19f5d2c6ce669241faacb8a1b2294.tar.gz |
Merge "Periodically maintain connection caches"
Diffstat (limited to 'zuul/driver/gerrit')
-rw-r--r-- | zuul/driver/gerrit/gerritconnection.py | 10 |
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): |