From ce596f4d2b2236beb61fdb786c0f7b822ed8201c Mon Sep 17 00:00:00 2001 From: Jake Rosenberg Date: Mon, 13 May 2024 09:59:38 -0500 Subject: [PATCH] use async task for publication --- designsafe/apps/api/publications_v2/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designsafe/apps/api/publications_v2/views.py b/designsafe/apps/api/publications_v2/views.py index 4203f0828c..fc1b3799cc 100644 --- a/designsafe/apps/api/publications_v2/views.py +++ b/designsafe/apps/api/publications_v2/views.py @@ -9,7 +9,7 @@ from designsafe.apps.api.publications_v2.models import Publication from designsafe.apps.api.projects_v2.models.project_metadata import ProjectMetadata from designsafe.apps.api.projects_v2.operations.project_publish_operations import ( - publish_project, + publish_project_async, ) logger = logging.getLogger(__name__) @@ -81,7 +81,7 @@ def post(self, request: HttpRequest): "User does not have access to the requested project", status=403 ) from exc - publish_project(project_id, entities_to_publish, dry_run=False) + publish_project_async.apply_async([project_id, entities_to_publish]) logger.debug(project_id) logger.debug(entities_to_publish) return JsonResponse({"result": "OK"})