Stream-Framework
Stream-Framework copied to clipboard
FallbackHashCache::get_many need a protection from get_many_from_fallback invoke
Hi,
FallbackHashCache::get_many() ... # query missing results from the database and store them if database_fallback: missing_keys = [f for f in fields if not results[f]] database_results = self.get_many_from_fallback(missing_keys) # update our results with the data from the db and send them to # redis results.update(database_results) self.set_many(database_results.items()) When I am trying to use the fallback db functionality, I have some finding for you reference.
- missing_keys could be an empty list, better to skip following query from DB.
- database_results could be empty list too if query db returning a null list. this will raise a exception when database_results.items().