Skip to content

Build: don't run_post_build_tasks in a task #13261

Description

@stsewd

Two things here:

It's run as a side effect of saving an object using the API. It should have its own endpoint.

def perform_update(self, serializer):
"""
Run the post-build tasks when an isolated build reaches a final state.
"""
# Read before saving: this is still the state stored in the database.
was_finished = serializer.instance.finished
build = serializer.save()
if (
not was_finished
and build.finished
and build.project.has_feature(Feature.USE_ISOLATED_BUILDER)
):
run_post_build_tasks.delay(build_pk=build.pk)

It's run as a task, but it doesn't have any blocking calls (everything blocking is called as a task inside it). We should make this a function or call the blocking calls directly.

def run_post_build_tasks(build_pk):

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions