Slightly slower flushing/queue checking on the main thread

This commit is contained in:
Sybren A. Stüvel 2018-03-26 17:12:03 +02:00
parent 21fb18247d
commit 099d51c4ff

View File

@ -155,7 +155,7 @@ class FileTransferer(threading.Thread, metaclass=abc.ABCMeta):
return return
try: try:
src, dst, action = self.queue.get(timeout=0.1) src, dst, action = self.queue.get(timeout=0.5)
self.progress_cb.transfer_file(src, dst) self.progress_cb.transfer_file(src, dst)
yield src, dst, action yield src, dst, action
except queue.Empty: except queue.Empty:
@ -177,7 +177,7 @@ class FileTransferer(threading.Thread, metaclass=abc.ABCMeta):
self.log.warning('Timeout while waiting for transfer to finish') self.log.warning('Timeout while waiting for transfer to finish')
return return
self.progress_cb.flush(timeout=0.1) self.progress_cb.flush(timeout=0.5)
# Since Thread.join() neither returns anything nor raises any exception # Since Thread.join() neither returns anything nor raises any exception
# when timing out, we don't even have to call it any more. # when timing out, we don't even have to call it any more.