remove dependency on redis json

This commit is contained in:
Simon
2024-12-22 22:59:48 +07:00
parent 7ffa6ff807
commit fbd7c19a93
8 changed files with 43 additions and 37 deletions

View File

@@ -103,8 +103,7 @@ class TaskIDView(ApiBaseView):
message = {"message": "task can not be stopped"}
return Response(message, status=400)
message_key = self._build_message_key(task_conf, task_id)
TaskCommand().stop(task_id, message_key)
TaskCommand().stop(task_id)
if command == "kill":
if not task_conf.get("api_stop"):
message = {"message": "task can not be killed"}
@@ -114,10 +113,6 @@ class TaskIDView(ApiBaseView):
return Response({"message": "command sent"})
def _build_message_key(self, task_conf, task_id):
"""build message key to forward command to notification"""
return f"message:{task_conf.get('group')}:{task_id.split('-')[0]}"
class ScheduleListView(ApiBaseView):
"""resolves to /api/task/schedule/