1
0
Fork 0

avoid reusing routes

This commit is contained in:
Sean Sube 2024-01-03 19:15:33 -06:00
parent 44a8d61082
commit a6baf369d4
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 5 additions and 1 deletions

View File

@ -632,6 +632,10 @@ def ready(server: ServerContext, pool: DevicePoolExecutor):
) )
def job_create(server: ServerContext, pool: DevicePoolExecutor):
return chain(server, pool)
def job_cancel(server: ServerContext, pool: DevicePoolExecutor): def job_cancel(server: ServerContext, pool: DevicePoolExecutor):
legacy_job_name = request.args.get("job", None) legacy_job_name = request.args.get("job", None)
job_list = request.args.get("jobs", "").split(",") job_list = request.args.get("jobs", "").split(",")
@ -684,7 +688,7 @@ def register_api_routes(app: Flask, server: ServerContext, pool: DevicePoolExecu
return [ return [
app.route("/api")(wrap_route(introspect, server, app=app)), app.route("/api")(wrap_route(introspect, server, app=app)),
# job routes # job routes
app.route("/api/job", methods=["POST"])(wrap_route(chain, server, pool=pool)), app.route("/api/job", methods=["POST"])(wrap_route(job_create, server, pool=pool)),
app.route("/api/job/cancel", methods=["PUT"])( app.route("/api/job/cancel", methods=["PUT"])(
wrap_route(job_cancel, server, pool=pool) wrap_route(job_cancel, server, pool=pool)
), ),