Description
The org deletion background job currently deletes all of the org's archived items as its first step. This code path ends up creating a background job to delete each one of every file's replicas (see: https://github.com/webrecorder/browsertrix/blob/main/backend/btrixcloud/basecrawls.py#L494). This results in very large overhead for an action that could be made much more efficient - namely, creating a single background job for each configured storage location to delete all files with that org's prefix.
We likely still want this deletion to be subject to the replica deletion delay as a precaution against accidental or malicious org deletion.
Context
No response
Description
The org deletion background job currently deletes all of the org's archived items as its first step. This code path ends up creating a background job to delete each one of every file's replicas (see: https://github.com/webrecorder/browsertrix/blob/main/backend/btrixcloud/basecrawls.py#L494). This results in very large overhead for an action that could be made much more efficient - namely, creating a single background job for each configured storage location to delete all files with that org's prefix.
We likely still want this deletion to be subject to the replica deletion delay as a precaution against accidental or malicious org deletion.
Context
No response