Add branch cache ltime to trigger events

In case a project(-branch) cache is cleared we add the cache ltime to
the trigger event. This ltime can later be used to determine if the
project branch cache needs to be refreshed.

Change-Id: I25d2ffb144e3a80856b10c920b42c37ef5ac9235
This commit is contained in:
Simon Westphahl
2021-11-04 11:56:28 +01:00
parent 0e9cb51426
commit 6a5510926a
3 changed files with 8 additions and 4 deletions

View File

@@ -192,6 +192,7 @@ class ZKBranchCacheMixin:
# but for the moment, implement the lowest common
# denominator and clear the cache so that we query.
self._branch_cache.clearProjectCache(project.name)
event.branch_cache_ltime = self._branch_cache.ltime
return event
def getProjectBranches(self, project, tenant, min_ltime=-1):
@@ -273,6 +274,7 @@ class ZKBranchCacheMixin:
project_name)
self._branch_cache.clearProtectedProjectCache(
project_name)
event.branch_cache_ltime = self._branch_cache.ltime
event.branch_protected = protected
else: