Open
Conversation
026b762 to
f3d0e51
Compare
4ae54c8 to
97556a8
Compare
Member
Author
I’ve pushed some new commits. Could you please review them again and let me know if there are any concerns? |
Contributor
The design is wrong and not worth to review. If your plan is "the enum can be reused for other storages in the future", you need a separate table like "storage_file_deletion (storage_type, storage_path)", but not keep patching other tables. |
…torage could reuse the deletion infrastructure
Member
Author
|
@lafriks @wxiaoguang I reimplemented it and use a standalone table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor attachment deletion logic
The attachment of comment deletion process has been moved from the
AfterDeletehook to the service layer. This change avoids scenarios where files are deleted while the database transaction is later rolled back. The new implementation introduces a two-stage deletion process via adding a new table namedstorage_path_deletion. All files need to be deleted will be added here and then a cron job will check it and delete the files. If file deletion fails repeatedly, a system notice will be issued to alert administrators.This will also improve performance when deleting a release with many files.
Removed unused functions
DeleteAttachmentsByIssueandDeleteAttachmentsByCommentare removed because only tests need them.