Skip to content
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

#1276, Refactor AsyncBatchDestroyJob to increase efficiency #1357

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ivanov-Anton
Copy link
Collaborator

@Ivanov-Anton Ivanov-Anton commented Oct 20, 2023

Description

The AsyncBatchDestroyJob has been refactored to utilise Rails's find_in_batches
method as opposed to a custom SQL query. This proves to make the process of record
deletion both more efficient and more resilient to database inconsistencies.

Previously, records that could not be deleted due to dependencies would raise an
exception, breaking the whole transaction. Now, these records are logged and
skipped over instead. Updates to associated tests have been made to verify and
reflect these changes.

Additional links

closes #1276

@Ivanov-Anton Ivanov-Anton self-assigned this Oct 20, 2023
@dmitry-sinina
Copy link
Contributor

@Ivanov-Anton I am not sure this is good idea. From my point of view we should not allow deletion of used numberlist.

@dmitry-sinina
Copy link
Contributor

I think we need some validation to fix #1276
May be background job should skip such objects during deletion.

…y and resilience

The AsyncBatchDestroyJob has been refactored to utilise Rails's `find_in_batches`
method as opposed to a custom SQL query. This proves to make the process of record
deletion both more efficient and more resilient to database inconsistencies.

Previously, records that could not be deleted due to dependencies would raise an
exception, breaking the whole transaction. Now, these records are logged and
skipped over instead. Updates to associated tests have been made to verify and
reflect these changes.
@Ivanov-Anton Ivanov-Anton force-pushed the YETIWEB-1276-Bacth-actions-job-validations-for-numberlists branch from 6a39019 to 5b24d6c Compare October 20, 2023 22:23
@Ivanov-Anton Ivanov-Anton changed the title #1276, Change dependent action for customers_auth to nullify #1276, Refactor AsyncBatchDestroyJob to increase efficiency and resilience Oct 20, 2023
@Ivanov-Anton Ivanov-Anton changed the title #1276, Refactor AsyncBatchDestroyJob to increase efficiency and resilience #1276, Refactor AsyncBatchDestroyJob to increase efficiency Oct 20, 2023
@Ivanov-Anton Ivanov-Anton marked this pull request as draft October 25, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bacth actions job validations for numberlists
2 participants