Fix sync not correctly being canceled

This commit is contained in:
croneter 2018-11-26 17:58:15 +01:00
parent 752a57c15e
commit 55ec381bfe
5 changed files with 6 additions and 6 deletions

View file

@ -70,7 +70,7 @@ class FanartThread(backgroundthread.KillableThread):
self.callback(finished) self.callback(finished)
class FanartTask(backgroundthread.Task, common.libsync_mixin): class FanartTask(common.libsync_mixin, backgroundthread.Task):
""" """
This task will also be executed while library sync is suspended! This task will also be executed while library sync is suspended!
""" """

View file

@ -27,7 +27,7 @@ def reset_collections():
COLLECTION_XMLS = {} COLLECTION_XMLS = {}
class GetMetadataTask(backgroundthread.Task, common.libsync_mixin): class GetMetadataTask(common.libsync_mixin, backgroundthread.Task):
""" """
Threaded download of Plex XML metadata for a certain library item. Threaded download of Plex XML metadata for a certain library item.
Fills the queue with the downloaded etree XML objects Fills the queue with the downloaded etree XML objects

View file

@ -39,7 +39,7 @@ class DeleteItem(object):
self.plex_id = plex_id self.plex_id = plex_id
class ProcessMetadata(backgroundthread.KillableThread, common.libsync_mixin): class ProcessMetadata(common.libsync_mixin, backgroundthread.KillableThread):
""" """
Not yet implemented for more than 1 thread - if ever. Only to be called by Not yet implemented for more than 1 thread - if ever. Only to be called by
ONE thread! ONE thread!

View file

@ -152,8 +152,8 @@ class Service():
i = 0 i = 0
while app.SYNC.db_scan: while app.SYNC.db_scan:
i += 1 i += 1
app.APP.monitor.waitForAbort(0.05) app.APP.monitor.waitForAbort(0.1)
if i > 100: if i > 150:
LOG.error('Could not stop library sync, aborting log-out') LOG.error('Could not stop library sync, aborting log-out')
# Failed to reset PMS and plex.tv connects. Try to restart Kodi # Failed to reset PMS and plex.tv connects. Try to restart Kodi
utils.messageDialog(utils.lang(29999), utils.lang(39208)) utils.messageDialog(utils.lang(29999), utils.lang(39208))

View file

@ -495,7 +495,7 @@ def reset(ask_user=True):
from . import app from . import app
# first stop any db sync # first stop any db sync
app.APP.suspend_threads = True app.APP.suspend_threads = True
count = 10 count = 15
while app.SYNC.db_scan: while app.SYNC.db_scan:
LOG.debug("Sync is running, will retry: %s...", count) LOG.debug("Sync is running, will retry: %s...", count)
count -= 1 count -= 1