Skip to content
Snippets Groups Projects
Commit d8fc6385 authored by Erik Reid's avatar Erik Reid
Browse files

use ThreadPoolExecutor to support testing tests

responses lib module doesn't work with ProcessPoolExecutor
parent ea8a090b
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ import time
import json
import datetime
from concurrent.futures import Future
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from concurrent.futures import ThreadPoolExecutor
from brian_dashboard_manager.config import DEFAULT_ORGANIZATIONS, STATE_PATH
from brian_dashboard_manager.grafana.utils.request import AdminRequest, \
TokenRequest
......@@ -311,7 +311,7 @@ def _provision_interfaces(config, org_config, ds_name, token):
ifaces.append(iface)
# provision dashboards and their folders
with ProcessPoolExecutor(max_workers=MAX_WORKERS) as executor:
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
provisioned = []
for folder in DASHBOARDS.values():
folder_name = folder['folder_name']
......@@ -410,7 +410,7 @@ def _provision_aggregates(config, org_config, ds_name, token):
# don't provision aggregate folder
delete_folder(token, title='Aggregates')
else:
with ProcessPoolExecutor(max_workers=MAX_WORKERS) as executor:
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
provisioned = []
agg_folder = find_folder(token, 'Aggregates')
for dash in AGG_DASHBOARDS.values():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment