From c06e1933ffd8eb9d0ad3759bd7a1ca47b92c9d77 Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Thu, 17 Oct 2024 10:34:17 -0400 Subject: [PATCH] Update docstrings and comments --- backend/btrixcloud/storages.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/backend/btrixcloud/storages.py b/backend/btrixcloud/storages.py index 8a834996e5..7e8feb0384 100644 --- a/backend/btrixcloud/storages.py +++ b/backend/btrixcloud/storages.py @@ -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") @@ -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: @@ -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, @@ -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 @@ -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,