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

Added management command to delete old pipeline errors #122

Open
wants to merge 4 commits into
base: develop-koa
Choose a base branch
from

Conversation

muhammadali286
Copy link

This command deletes the records from figures_pipelineerror table. It takes days as an argument, it is the number of days to retain Pipeline Error records. Defaults to 15.

Comment on lines +36 to +38
ids_to_delete = list(old_records.values_list('id', flat=True))
PipelineError.objects.filter(id__in=ids_to_delete).delete()
total_deleted += len(ids_to_delete)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we replace this logic with a single query by deleting the records directly?

deleted, _ = old_records.delete()

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.

2 participants