Skip to content

Commit 0295c7b

Browse files
committed
improve the comment
1 parent c89d939 commit 0295c7b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

services/org/org.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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.
5050
func 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 {

0 commit comments

Comments
 (0)