Log cache misses.

This commit is contained in:
voussoir 2021-01-07 19:23:34 -08:00
parent 484e3ae1ee
commit fb126a0540

View file

@ -273,6 +273,7 @@ class PDBCacheManagerMixin:
try: try:
thing = thing_cache[thing_id] thing = thing_cache[thing_id]
except KeyError: except KeyError:
self.log.loud('Cache miss %s %s.', thing_type, thing_id)
thing = thing_class(self, db_row) thing = thing_class(self, db_row)
thing_cache[thing_id] = thing thing_cache[thing_id] = thing
return thing return thing
@ -385,6 +386,11 @@ class PDBCacheManagerMixin:
else: else:
yield thing yield thing
if not ids_needed:
return
self.log.loud('Cache miss %s %s.', thing_type, ids_needed)
ids_needed = list(ids_needed) ids_needed = list(ids_needed)
while ids_needed: while ids_needed:
# SQLite3 has a limit of 999 ? in a query, so we must batch them. # SQLite3 has a limit of 999 ? in a query, so we must batch them.