Skip to content
Snippets Groups Projects
Commit 8e51e70c authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

ensure process executors are always shutdown

parent 4391009f
No related branches found
No related tags found
No related merge requests found
...@@ -977,16 +977,19 @@ def get_dashboard_data( ...@@ -977,16 +977,19 @@ def get_dashboard_data(
""" """
with ProcessPoolExecutor(max_workers=NUM_PROCESSES) as executor: with ProcessPoolExecutor(max_workers=NUM_PROCESSES) as executor:
for dash in executor.map( try:
partial( for dash in executor.map(
get_dashboard_data_single, partial(
datasource=datasource, get_dashboard_data_single,
tag=tag, datasource=datasource,
panel_generator=panel_generator, tag=tag,
errors=errors), panel_generator=panel_generator,
data.items() errors=errors),
): data.items()
yield dash ):
yield dash
finally:
executor.shutdown(wait=False, cancel_futures=True)
def create_aggregate_panel(title, gridpos, targets, datasource): def create_aggregate_panel(title, gridpos, targets, datasource):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment