Optimize sleep for librarysync threads

This commit is contained in:
tomkat83 2016-09-10 11:27:27 +02:00
parent 2c7850a9d7
commit 497d71cacc

View file

@ -62,7 +62,7 @@ class ThreadedGetMetadata(Thread):
try: try:
self.queue.get(block=False) self.queue.get(block=False)
except Queue.Empty: except Queue.Empty:
xbmc.sleep(50) xbmc.sleep(10)
continue continue
else: else:
self.queue.task_done() self.queue.task_done()
@ -73,7 +73,7 @@ class ThreadedGetMetadata(Thread):
try: try:
self.out_queue.get(block=False) self.out_queue.get(block=False)
except Queue.Empty: except Queue.Empty:
xbmc.sleep(50) xbmc.sleep(10)
continue continue
else: else:
self.out_queue.task_done() self.out_queue.task_done()
@ -93,7 +93,7 @@ class ThreadedGetMetadata(Thread):
updateItem = queue.get(block=False) updateItem = queue.get(block=False)
# Empty queue # Empty queue
except Queue.Empty: except Queue.Empty:
xbmc.sleep(100) xbmc.sleep(10)
continue continue
# Download Metadata # Download Metadata
plexXML = PF.GetPlexMetadata(updateItem['itemId']) plexXML = PF.GetPlexMetadata(updateItem['itemId'])
@ -155,7 +155,7 @@ class ThreadedProcessMetadata(Thread):
try: try:
self.queue.get(block=False) self.queue.get(block=False)
except Queue.Empty: except Queue.Empty:
xbmc.sleep(100) xbmc.sleep(10)
continue continue
else: else:
self.queue.task_done() self.queue.task_done()
@ -175,7 +175,7 @@ class ThreadedProcessMetadata(Thread):
try: try:
updateItem = queue.get(block=False) updateItem = queue.get(block=False)
except Queue.Empty: except Queue.Empty:
xbmc.sleep(50) xbmc.sleep(10)
continue continue
# Do the work # Do the work
plexitem = updateItem['XML'] plexitem = updateItem['XML']
@ -250,7 +250,7 @@ class ThreadedShowSyncInfo(Thread):
processMetadataProgress, processMetadataProgress,
viewName)) viewName))
# Sleep for x milliseconds # Sleep for x milliseconds
xbmc.sleep(500) xbmc.sleep(200)
dialog.close() dialog.close()
log.debug('Dialog Infobox thread terminated') log.debug('Dialog Infobox thread terminated')