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

Feat/handle error deleting old resource #138

Merged
merged 10 commits into from
Dec 4, 2024

Conversation

bellisk
Copy link
Contributor

@bellisk bellisk commented Dec 2, 2024

No description provided.

@bellisk bellisk force-pushed the feat/handle-error-deleting-old-resource branch from a1d6baf to b0e90ea Compare December 2, 2024 13:59
@bellisk bellisk force-pushed the feat/handle-error-deleting-old-resource branch from b0e90ea to e96a8ca Compare December 2, 2024 14:08
@bellisk bellisk changed the base branch from main to migration December 2, 2024 14:08
This is necessary if we are calling this helper while not actually in a request context.
If we get into a state where we have duplicate resources for the same filename (e.g. because we created a new resource for the filename but deleting the old resource failed), we must not delete resources by filename in the finalize step! If we do, we will delete both the new and the old resource for the filename.

This method is already a lot simpler than it used to be, since CKAN no longer stores lots of old versions of resources in the database, so it's safe to change it to delete resources by id.
This will also clean up the filestore of old versions of files that are
otherwise not cleaned up.
@bellisk bellisk marked this pull request as ready for review December 2, 2024 18:33
@bellisk bellisk merged commit e3e2b0d into migration Dec 4, 2024
4 checks passed
@bellisk bellisk deleted the feat/handle-error-deleting-old-resource branch December 4, 2024 09:13
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