Ensure that the all_ids() call does not cause locking issues

This commit is contained in:
Kovid Goyal 2013-08-30 08:10:01 +05:30
parent c10d73e5c6
commit 6908eea3e9

View File

@ -143,8 +143,8 @@ class LibraryDatabase(object):
self.data.cache.initialize_template_cache()
def all_ids(self):
for book_id in self.new_api.all_book_ids():
yield book_id
'All book ids in the db. This can no longer be a generator because of db locking.'
return tuple(self.new_api.all_book_ids())
def is_empty(self):
with self.new_api.read_lock: