Let full_sync finish gracefully on Kodi exit

This commit is contained in:
croneter 2018-11-09 08:56:57 +01:00
parent e37223f016
commit 7830a0e0e3
2 changed files with 6 additions and 1 deletions

View file

@ -118,4 +118,5 @@ class GetMetadataTask(backgroundthread.Task, common.libsync_mixin):
self.plex_id) self.plex_id)
else: else:
item['children'] = children_xml item['children'] = children_xml
self.queue.put(item) if not self.isCanceled():
self.queue.put(item)

View file

@ -106,4 +106,8 @@ class ProcessMetadata(backgroundthread.KillableThread, common.libsync_mixin):
finally: finally:
if self.dialog: if self.dialog:
self.dialog.close() self.dialog.close()
while not self.queue.empty():
# We need to empty the queue to let full_sync finish join()
self.queue.get()
self.queue.task_done()
LOG.debug('Processing thread terminated') LOG.debug('Processing thread terminated')