Giter Site home page Giter Site logo

Comments (1)

lTimej avatar lTimej commented on May 18, 2024

问题:

周期任务之前的执行人是绑死周期任务的创建者,目前需要优化将周期任务得执行人改为周期任务得更新人,但是对于pipeline引擎层没有editor这个概念

方案:

在修改周期任务的时候,同时把PipelinePeriodicTask这张表的creator修改为周期任务的editor,因为周期任务执行pipelineinstance将PipelinePeriodicTask的creator跟creator绑定
def partial_update(self, request, *args, **kwargs):
instance = self.get_object()
... ...
with transaction.atomic():
instance.editor = request.user.username
instance.save(update_fields=["editor", "edit_time"])
instance.task.creator = request.user.username
instance.task.save()

影响:

这种修改会出现一种问题,a用户创建两个周期任务,上线后b用户修改了任务1没有修改任务2,结果任务1执行人是吧b,任务2执行人a,可能会让用户感觉混乱
任务1. creator: a, updator: b, excutor: b
任务2. creator: a, updator: "",excutor: a``

from bk-sops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.