Skip to content

Commit d53c1ac

Browse files
authored
Revert "Don't fire off a stampeded of Team/Project deletion tasks (#4006)" (#4067)
This reverts commit 3735627. Revert "Don't explicitly say continuous=False when deleting teams and projects (#4052)" This reverts commit 3916932.
1 parent 8268467 commit d53c1ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sentry/tasks/deletion.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def delete_organization(object_id, transaction_id=None, continuous=True, **kwarg
3838
o.update(status=OrganizationStatus.DELETION_IN_PROGRESS)
3939
pending_delete.send(sender=Organization, instance=o)
4040

41-
for team in Team.objects.filter(organization=o).exclude(status=TeamStatus.DELETION_IN_PROGRESS).order_by('id')[:1]:
41+
for team in Team.objects.filter(organization=o).order_by('id')[:1]:
4242
team.update(status=TeamStatus.DELETION_IN_PROGRESS)
43-
delete_team(team.id, transaction_id=transaction_id)
43+
delete_team(team.id, transaction_id=transaction_id, continuous=False)
4444
if continuous:
4545
delete_organization.apply_async(
4646
kwargs={'object_id': object_id, 'transaction_id': transaction_id},
@@ -86,9 +86,9 @@ def delete_team(object_id, transaction_id=None, continuous=True, **kwargs):
8686
t.update(status=TeamStatus.DELETION_IN_PROGRESS)
8787

8888
# Delete 1 project at a time since this is expensive by itself
89-
for project in Project.objects.filter(team=t).exclude(status=ProjectStatus.DELETION_IN_PROGRESS).order_by('id')[:1]:
89+
for project in Project.objects.filter(team=t).order_by('id')[:1]:
9090
project.update(status=ProjectStatus.DELETION_IN_PROGRESS)
91-
delete_project(project.id, transaction_id=transaction_id)
91+
delete_project(project.id, transaction_id=transaction_id, continuous=False)
9292
if continuous:
9393
delete_team.apply_async(
9494
kwargs={'object_id': object_id, 'transaction_id': transaction_id},

0 commit comments

Comments
 (0)