avoid reusing routes
This commit is contained in:
parent
44a8d61082
commit
a6baf369d4
|
@ -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)
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue