only add to cache if not empty
This commit is contained in:
parent
a38d7bef9c
commit
1176c35981
@ -78,6 +78,11 @@ class StreamData():
|
||||
return self.values.get("description")
|
||||
def complete(self):
|
||||
return None not in self.values.values()
|
||||
def has_data(self):
|
||||
for elem in self.values.values():
|
||||
if isinstance(elem, str):
|
||||
return True
|
||||
return False
|
||||
def meta(self):
|
||||
data = []
|
||||
if isinstance(self.values.get("thumbnail"), str):
|
||||
@ -246,6 +251,7 @@ async def get_from_runner(cache_key, runner, logger):
|
||||
except Exception as e:
|
||||
logger.info(e)
|
||||
else:
|
||||
if isinstance(result_temp, StreamData) and result_temp.has_data():
|
||||
upstream_cache[cache_key] = result_temp
|
||||
result = result_temp
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user