From 0ee000509a3d54a088f39291bf3ffcf5fb587d4e Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Tue, 12 Mar 2024 10:33:18 +1100 Subject: [PATCH] Move resource lock to parent function. --- .../src/project/apps/workshops/manager/portal.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/training-portal/src/project/apps/workshops/manager/portal.py b/training-portal/src/project/apps/workshops/manager/portal.py index fa533362..d7bc5181 100644 --- a/training-portal/src/project/apps/workshops/manager/portal.py +++ b/training-portal/src/project/apps/workshops/manager/portal.py @@ -41,8 +41,9 @@ from .analytics import report_analytics_event -@resources_lock -@transaction.atomic +# XXX Disabled here as being handled in parent training_portal_event(). +# @resources_lock +# @transaction.atomic def initialize_robot_account(resource): """Initialize the robot user account if this is the first time the training portal has been started up. @@ -179,8 +180,9 @@ def workshops_configuration(portal, resource): return workshops -@resources_lock -@transaction.atomic +# XXX Disabled here as being handled in parent training_portal_event(). +# @resources_lock +# @transaction.atomic def process_training_portal(resource): """Process the training portal configuration, creating or updating the set of workshop environments, and creating or deleting reserved sessions. @@ -378,6 +380,7 @@ def start_reconciliation_task(name): and uid == settings.PORTAL_UID and event["type"] in (None, "MODIFIED"), ) +@resources_lock @transaction.atomic def training_portal_event(event, name, body, **_): """This is the key entry point for handling any changes to the