Skip to content

Commit

Permalink
Update docstrings and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Oct 17, 2024
1 parent 8d2f5d0 commit c06e193
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions backend/btrixcloud/storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async def add_custom_storage(
async def remove_custom_storage(
self, name: str, org: Organization
) -> dict[str, bool]:
"""remove custom storage"""
"""Remove custom storage from org"""
if org.storage.custom and org.storage.name == name:
raise HTTPException(status_code=400, detail="storage_in_use")

Expand All @@ -253,7 +253,7 @@ async def update_storage_ref(
org: Organization,
background_tasks: BackgroundTasks,
) -> dict[str, Union[bool, Optional[str]]]:
"""update storage for org"""
"""Update storage for org"""
storage_ref = storage_refs.storage

try:
Expand Down Expand Up @@ -291,9 +291,6 @@ async def update_storage_ref(
org, prev_storage_ref, storage_ref
)

# This runs only two update_many mongo commands, so should be safe to run
# in a FastAPI background task rather than requiring a full Browsertrix
# Background job
background_tasks.add_task(
self._run_post_storage_update_tasks,
org,
Expand Down Expand Up @@ -322,7 +319,7 @@ async def update_storage_replica_refs(
org: Organization,
background_tasks: BackgroundTasks,
) -> dict[str, bool]:
"""update storage for org"""
"""Update replica storage for org"""

replicas = storage_refs.storageReplicas

Expand Down Expand Up @@ -352,11 +349,6 @@ async def update_storage_replica_refs(

await self.org_ops.update_storage_refs(org, replicas=True)

# This only kicks off background jobs and runs a few update_many mongo
# commands, so it might be fine to keep as a FastAPI background job.
# Consider moving to a Browsertrix background job, but that may make
# retrying difficult as the job which would be retried also kicks off
# other background jobs which may have been successful already
background_tasks.add_task(
self._run_post_storage_replica_update_tasks,
org,
Expand Down

0 comments on commit c06e193

Please sign in to comment.