Don't sleep in job manager after having run jobs. This improves latency in some situations.

This commit is contained in:
Kovid Goyal 2012-07-26 19:24:30 +05:30
commit a5cf477417

View File

@ -317,9 +317,11 @@ class DeviceManager(Thread): # {{{
else: else:
self.detect_device() self.detect_device()
do_sleep = True
while True: while True:
job = self.next() job = self.next()
if job is not None: if job is not None:
do_sleep = False
self.current_job = job self.current_job = job
if self.device is not None: if self.device is not None:
self.device.set_progress_reporter(job.report_progress) self.device.set_progress_reporter(job.report_progress)
@ -327,7 +329,8 @@ class DeviceManager(Thread): # {{{
self.current_job = None self.current_job = None
else: else:
break break
time.sleep(self.sleep_time) if do_sleep:
time.sleep(self.sleep_time)
# We are exiting. Call the shutdown method for each plugin # We are exiting. Call the shutdown method for each plugin
for p in self.devices: for p in self.devices: