Fix accidentally removed try-finally, fix non-conditional queue.put
This commit is contained in:
parent
765ef00022
commit
06deaa1ed8
@ -501,8 +501,10 @@ class Nodes(object):
|
|||||||
'odir': odir,
|
'odir': odir,
|
||||||
'fake': fake},
|
'fake': fake},
|
||||||
key=key))
|
key=key))
|
||||||
self.nodes = tools.run_batch(run_items, 100, dict_result=True)
|
try:
|
||||||
lock.unlock()
|
self.nodes = tools.run_batch(run_items, 100, dict_result=True)
|
||||||
|
finally:
|
||||||
|
lock.unlock()
|
||||||
|
|
||||||
def calculate_log_size(self, timeout=15):
|
def calculate_log_size(self, timeout=15):
|
||||||
total_size = 0
|
total_size = 0
|
||||||
|
@ -67,7 +67,9 @@ class SemaphoreProcess(Process):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
self.queue.put_nowait(self.target(**self.args))
|
result = self.target(**self.args)
|
||||||
|
if self.queue:
|
||||||
|
self.queue.put_nowait(result)
|
||||||
finally:
|
finally:
|
||||||
logging.debug('finished call: %s' % self.target)
|
logging.debug('finished call: %s' % self.target)
|
||||||
self.semaphore.release()
|
self.semaphore.release()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user