Fix accidentally removed try-finally, fix non-conditional queue.put

This commit is contained in:
f3flight 2016-05-03 23:00:36 +00:00
parent 765ef00022
commit 06deaa1ed8
2 changed files with 7 additions and 3 deletions

View File

@ -501,8 +501,10 @@ class Nodes(object):
'odir': odir,
'fake': fake},
key=key))
self.nodes = tools.run_batch(run_items, 100, dict_result=True)
lock.unlock()
try:
self.nodes = tools.run_batch(run_items, 100, dict_result=True)
finally:
lock.unlock()
def calculate_log_size(self, timeout=15):
total_size = 0

View File

@ -67,7 +67,9 @@ class SemaphoreProcess(Process):
def run(self):
try:
self.queue.put_nowait(self.target(**self.args))
result = self.target(**self.args)
if self.queue:
self.queue.put_nowait(result)
finally:
logging.debug('finished call: %s' % self.target)
self.semaphore.release()