-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
任务执行前需要校验任务是否已删除 #7307
Labels
Comments
def task_action(self, action, username):
# self: 任务对象
# 在这里增加一个判断,判断任务是否被删除
if self.is_deleted: # 为True,终止执行
message = _(f"任务操作失败: 任务[ID: {self.id}]已被删除")
logger.error(message)
return {"result": False, "message": message, "code": err_code.INVALID_OPERATION.code}
........
# 任务命令分发
dispatcher = TaskCommandDispatcher(
engine_ver=self.engine_ver,
taskflow_id=self.id,
pipeline_instance=self.pipeline_instance,
project_id=self.project_id,
queue=self._get_task_celery_queue(self.engine_ver),
)
...... |
lTimej
added a commit
to lTimej/bk-sops
that referenced
this issue
Jan 26, 2024
lTimej
added a commit
to lTimej/bk-sops
that referenced
this issue
Jan 29, 2024
lTimej
added a commit
to lTimej/bk-sops
that referenced
this issue
Jan 29, 2024
normal-wls
pushed a commit
that referenced
this issue
Feb 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
用户 a 新建了任务,开着任务窗口但未执行
用户 b 删除了任务
用户 a 点执行 ,执行成功
The text was updated successfully, but these errors were encountered: