from concurrent.futures import ThreadPoolExecutor from flask import Blueprint, current_app from brian_dashboard_manager.routes import common from brian_dashboard_manager.grafana.provision import provision from brian_dashboard_manager import CONFIG_KEY routes = Blueprint("update", __name__) @routes.after_request def after_request(resp): return common.after_request(resp) @routes.route('/', methods=['GET']) def update(): executor = ThreadPoolExecutor(max_workers=1) executor.submit(provision, current_app.config[CONFIG_KEY]) return {'data': {'message': 'Provisioning dashboards!'}}