Skip to content

Commit

Permalink
Merge pull request #314 from GrahamDumpleton/portal-thread-locking
Browse files Browse the repository at this point in the history
Move resource lock to parent function.
  • Loading branch information
GrahamDumpleton authored Mar 11, 2024
2 parents b7b0716 + 0ee0005 commit 957dd61
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions training-portal/src/project/apps/workshops/manager/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand 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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 957dd61

Please sign in to comment.