|
@@ -9,6 +9,7 @@ from quart import Blueprint, jsonify, request
|
|
|
from .insertVideoRoute import insert
|
|
|
from .sourceIdRoute import saveSourceToDB
|
|
|
from .recallPQVideos import recallPQVideos
|
|
|
+from .process_killer import kill_task_by_name
|
|
|
|
|
|
from deal import tempServer
|
|
|
|
|
@@ -88,5 +89,24 @@ def Routes(db_client):
|
|
|
response = ts.chooseCards()
|
|
|
return jsonify(response)
|
|
|
|
|
|
+ @TL_blueprint.route("/KILL", methods=['GET'])
|
|
|
+ async def kill():
|
|
|
+ """
|
|
|
+ 杀掉进程
|
|
|
+ :return:
|
|
|
+ """
|
|
|
+ task_name = request.args.get("taskName")
|
|
|
+ if task_name:
|
|
|
+ if task_name in ['historyTask.py', 'newContentIdTask.py']:
|
|
|
+ status = await kill_task_by_name(task_name)
|
|
|
+ if status:
|
|
|
+ return jsonify({"message": "success"})
|
|
|
+ else:
|
|
|
+ return jsonify({"message": "failed"})
|
|
|
+ else:
|
|
|
+ return jsonify({"message": "task name error"})
|
|
|
+ else:
|
|
|
+ return jsonify({"message": "no task name"})
|
|
|
+
|
|
|
return TL_blueprint
|
|
|
|