File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,14 @@ func deleteOrganization(ctx context.Context, org *org_model.Organization) error
4848
4949// DeleteOrganization completely and permanently deletes everything of organization.
5050func DeleteOrganization (ctx context.Context , org * org_model.Organization , purge bool ) error {
51- // The repositories deletion of the organization cannot be under a transaction,
52- // because it cannot be rolled back because the content in disk will be deleted
53- // in the DeleteOwnerRepositoriesDirectly function.
54- // Even not all repositories deleted successfully, we still delete the organization again.
55- // TODO: We should mark all the repositories as deleted and delete them in a background job.
51+ // Deleting repositories under the organization cannot be wrapped in a transaction at the moment,
52+ // because the associated disk content is permanently deleted by the DeleteOwnerRepositoriesDirectly function,
53+ // which cannot be rolled back.
54+ //
55+ // Even if some repositories fail to delete, the organization will still be deleted.
56+ //
57+ // TODO: Consider marking repositories as "deleted" first,
58+ // and handling the actual deletion in a background job for better reliability and rollback support.
5659 if purge {
5760 err := repo_service .DeleteOwnerRepositoriesDirectly (ctx , org .AsUser ())
5861 if err != nil {
You can’t perform that action at this time.
0 commit comments