mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make covercache and backup stoppable.
This commit is contained in:
parent
e3781d0f15
commit
3e1cb3b5e0
@ -156,6 +156,8 @@ class BooksModel(QAbstractTableModel): # {{{
|
||||
self.cover_cache.stop()
|
||||
self.cover_cache = CoverCache(db, FunctionDispatcher(self.db.cover))
|
||||
self.cover_cache.start()
|
||||
if self.metadata_backup is not None:
|
||||
self.metadata_backup.stop()
|
||||
self.metadata_backup = MetadataBackup(db)
|
||||
self.metadata_backup.start()
|
||||
def refresh_cover(event, ids):
|
||||
|
@ -43,7 +43,7 @@ class MetadataBackup(Thread): # {{{
|
||||
def run(self):
|
||||
while self.keep_running:
|
||||
try:
|
||||
id_ = self.db.dirtied_queue.get()
|
||||
id_ = self.db.dirtied_queue.get(True, 2)
|
||||
except Empty:
|
||||
continue
|
||||
except:
|
||||
@ -122,7 +122,7 @@ class CoverCache(Thread): # {{{
|
||||
def run(self):
|
||||
while self.keep_running:
|
||||
try:
|
||||
id_ = self.load_queue.get()
|
||||
id_ = self.load_queue.get(True, 2)
|
||||
except Empty:
|
||||
continue
|
||||
except:
|
||||
|
Loading…
x
Reference in New Issue
Block a user