jobs.py 496 B
from flask import Blueprint, Response, current_app
from inventory_provider.tasks import worker
routes = Blueprint("inventory-data-job-routes", __name__)
@routes.route("/update", methods=['GET', 'POST'])
def update():
worker.start_refresh_cache_all(
current_app.config["INVENTORY_PROVIDER_CONFIG"])
return Response("OK")
@routes.route("update-interface-statuses")
def update_interface_statuses():
worker.update_interface_statuses().async_start()
return Response("OK")