-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref(cleanup): More functions #101066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(cleanup): More functions #101066
Conversation
This helps with the readability of the code.
This comment was marked as outdated.
This comment was marked as outdated.
| return False | ||
| return model.__name__.lower() not in model_list | ||
|
|
||
| bulk_query_deletes = generate_bulk_query_deletes() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| models_attempted, | ||
| ) | ||
|
|
||
| debug_output("Running bulk deletes in DELETES") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code has been moved within this function:
https://github.com/getsentry/sentry/pull/101066/files#diff-af1cde82f065157a87af5b9c019c93a9e93aeb22661494449dbca1628e3cf306R559
| models_attempted, | ||
| ) | ||
|
|
||
| if project_deletion_query is not None and len(to_delete_by_project): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code has been moved within:
https://github.com/getsentry/sentry/pull/101066/files#diff-af1cde82f065157a87af5b9c019c93a9e93aeb22661494449dbca1628e3cf306R592
| task_queue, project, project_id, is_filtered, days, models_attempted | ||
| ) | ||
|
|
||
| if organization_deletion_query is not None and len(to_delete_by_organization): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code has been moved within this function:
https://github.com/getsentry/sentry/pull/101066/files#diff-af1cde82f065157a87af5b9c019c93a9e93aeb22661494449dbca1628e3cf306R632
|
bugbot run |
|
|
||
| def _stop_pool(pool: Sequence[Process], task_queue: _WorkQueue) -> None: | ||
| # First, ensure all queued tasks are completed | ||
| task_queue.join() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever an exception is raised inside of the try/block, it may leave us without calling task_queue.join() in one of the steps, thus, it may make sense to completing the tasks before shutting down the pool.

This helps with the readability of the code.