pkgset: handle exception when using dogpile cache
JIRA: RHELCMP-562 Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
parent
f5bfd509ab
commit
6ac12af343
@ -417,25 +417,29 @@ class KojiPackageSet(PackageSetBase):
|
|||||||
if not tag:
|
if not tag:
|
||||||
return [], []
|
return [], []
|
||||||
|
|
||||||
|
response = None
|
||||||
if self.cache_region:
|
if self.cache_region:
|
||||||
cache_key = "KojiPackageSet.get_latest_rpms_%s_%s_%s" % (
|
cache_key = "KojiPackageSet.get_latest_rpms_%s_%s_%s" % (
|
||||||
tag,
|
str(tag),
|
||||||
str(event),
|
str(event),
|
||||||
str(inherit),
|
str(inherit),
|
||||||
)
|
)
|
||||||
cached_response = self.cache_region.get(cache_key)
|
try:
|
||||||
if cached_response:
|
response = self.cache_region.get(cache_key)
|
||||||
return cached_response
|
except Exception:
|
||||||
else:
|
pass
|
||||||
response = self.koji_proxy.listTaggedRPMS(
|
|
||||||
tag, event=event, inherit=inherit, latest=True
|
if not response:
|
||||||
)
|
response = self.koji_proxy.listTaggedRPMS(
|
||||||
self.cache_region.set(cache_key, response)
|
|
||||||
return response
|
|
||||||
else:
|
|
||||||
return self.koji_proxy.listTaggedRPMS(
|
|
||||||
tag, event=event, inherit=inherit, latest=True
|
tag, event=event, inherit=inherit, latest=True
|
||||||
)
|
)
|
||||||
|
if self.cache_region:
|
||||||
|
try:
|
||||||
|
self.cache_region.set(cache_key, response)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return response
|
||||||
|
|
||||||
def get_package_path(self, queue_item):
|
def get_package_path(self, queue_item):
|
||||||
rpm_info, build_info = queue_item
|
rpm_info, build_info = queue_item
|
||||||
|
Loading…
Reference in New Issue
Block a user