Log cache misses.
This commit is contained in:
parent
484e3ae1ee
commit
fb126a0540
1 changed files with 6 additions and 0 deletions
|
@ -273,6 +273,7 @@ class PDBCacheManagerMixin:
|
|||
try:
|
||||
thing = thing_cache[thing_id]
|
||||
except KeyError:
|
||||
self.log.loud('Cache miss %s %s.', thing_type, thing_id)
|
||||
thing = thing_class(self, db_row)
|
||||
thing_cache[thing_id] = thing
|
||||
return thing
|
||||
|
@ -385,6 +386,11 @@ class PDBCacheManagerMixin:
|
|||
else:
|
||||
yield thing
|
||||
|
||||
if not ids_needed:
|
||||
return
|
||||
|
||||
self.log.loud('Cache miss %s %s.', thing_type, ids_needed)
|
||||
|
||||
ids_needed = list(ids_needed)
|
||||
while ids_needed:
|
||||
# SQLite3 has a limit of 999 ? in a query, so we must batch them.
|
||||
|
|
Loading…
Reference in a new issue