Simplufy shouldRefresh* checks
In comments on I3824af6149bf27c41a8d895fc682236bd0d91f6b Clark Boylan suggested that an equality check of the version number might be a simpler and more robust way of checking that an object should be refreshed. This change implements that suggestion. Change-Id: I9261fc68442e4002c4579db4f99d3c151ffd485c
This commit is contained in:
parent
6a4f752ca6
commit
f1e4ef1611
@ -4411,19 +4411,15 @@ class BuildSet(zkobject.ZKObject):
|
||||
if (COMPONENT_REGISTRY.model_api < 12):
|
||||
return True
|
||||
current = build.getZKVersion()
|
||||
if current is None:
|
||||
current = -1
|
||||
expected = self.build_versions.get(build.uuid, 0)
|
||||
return expected > current
|
||||
return expected != current
|
||||
|
||||
def shouldRefreshJob(self, job):
|
||||
if (COMPONENT_REGISTRY.model_api < 12):
|
||||
return True
|
||||
current = job.getZKVersion()
|
||||
if current is None:
|
||||
current = -1
|
||||
expected = self.job_versions.get(job.name, 0)
|
||||
return expected > current
|
||||
return expected != current
|
||||
|
||||
@property
|
||||
def ref(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user