From fb5e5d6acbc797115fc584e5eb18e753ad252345 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 26 Jul 2012 14:57:36 +0200 Subject: [PATCH] Don't sleep in job manager after having run jobs. This improves latency in some situations. --- src/calibre/gui2/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index d4b8aa0e9b..748d917146 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -317,9 +317,11 @@ class DeviceManager(Thread): # {{{ else: self.detect_device() + do_sleep = True while True: job = self.next() if job is not None: + do_sleep = False self.current_job = job if self.device is not None: self.device.set_progress_reporter(job.report_progress) @@ -327,7 +329,8 @@ class DeviceManager(Thread): # {{{ self.current_job = None else: break - time.sleep(self.sleep_time) + if do_sleep: + time.sleep(self.sleep_time) # We are exiting. Call the shutdown method for each plugin for p in self.devices: