Skip to content

Commit

Permalink
fix: apply atomic before registration
Browse files Browse the repository at this point in the history
  • Loading branch information
WizzyGeek committed Jan 28, 2024
1 parent 8e95a25 commit 0abe54d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pwncore/routes/ctf/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
logger = getLogger(__name__)


@atomic()
@router.post("/{ctf_id}/start")
@atomic()
async def start_docker_container(ctf_id: int, response: Response, jwt: RequireJwt):
"""
image_config contains the raw POST data that gets sent to the Docker Remote API.
Expand Down Expand Up @@ -109,8 +109,8 @@ async def start_docker_container(ctf_id: int, response: Response, jwt: RequireJw
}


@atomic()
@router.post("/stopall")
@atomic()
async def stopall_docker_container(response: Response, jwt: RequireJwt):
team_id = jwt["team_id"] # From JWT

Expand All @@ -132,8 +132,8 @@ async def stopall_docker_container(response: Response, jwt: RequireJwt):
return {"msg_code": config.msg_codes["containers_team_stop"]}


@atomic()
@router.post("/{ctf_id}/stop")
@atomic()
async def stop_docker_container(ctf_id: int, response: Response, jwt: RequireJwt):
# Let this work on invisible problems incase
# we mess up the database while making problems visible
Expand Down

0 comments on commit 0abe54d

Please sign in to comment.