Skip to content

Commit 2b276e3

Browse files
committed
Update parallel_executor.py
1 parent 580a881 commit 2b276e3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

qgate_perf/parallel_executor.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _executeCore(self, run_setup: RunSetup, return_dict, processes=2, threads=2)
9494
args=(threads, process_key, return_dict, run_setup))
9595
proc.append(p)
9696

97-
# start
97+
# start all
9898
for p in proc:
9999
p.start()
100100

@@ -222,7 +222,8 @@ def run_executor(self, executor_list = [[2, 1, '1x thread'], [2, 2, '2x thread']
222222
output.print(f"SYSTEM ERROR in 'run_executor': {type(ex).__name__} - '{str(ex) if ex is not None else '!! Noname exception !!'}'")
223223
performance.add_state(False)
224224
finally:
225-
output.close()
225+
if output:
226+
output.close()
226227

227228
return performance
228229

@@ -277,7 +278,8 @@ def run(self, processes = 2, threads = 2, run_setup: RunSetup = None, performanc
277278
output.print(f"SYSTEM ERROR in 'run': '{str(e) if e is not None else '!! Noname exception !!'}'")
278279
performance.add_state(False)
279280
finally:
280-
output.close()
281+
if output:
282+
output.close()
281283

282284
return performance
283285

0 commit comments

Comments
 (0)