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): |
Two things here:
It's run as a side effect of saving an object using the API. It should have its own endpoint.
readthedocs.org/readthedocs/api/v2/views/model_views.py
Lines 264 to 277 in a9b1438
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.
readthedocs.org/readthedocs/builds/tasks.py
Line 705 in a9b1438