Skip to content

Commit

Permalink
Delete deleted release attachments immediately from storage (go-gitea…
Browse files Browse the repository at this point in the history
…#23913) (go-gitea#23958)

Backport go-gitea#23913 by @lunny

Previously, deleted release attachments were kept forever on the
external storage.
Note: It may be very slow now if there are many attachments to be
deleted on this release.

Fix go-gitea#23728

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
GiteaBot and lunny committed Apr 6, 2023
1 parent 8092251 commit 001d3fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod
deletedUUIDs.Add(attach.UUID)
}

if _, err := repo_model.DeleteAttachments(ctx, attachments, false); err != nil {
if _, err := repo_model.DeleteAttachments(ctx, attachments, true); err != nil {
return fmt.Errorf("DeleteAttachments [uuids: %v]: %w", delAttachmentUUIDs, err)
}
}
Expand Down

0 comments on commit 001d3fb

Please sign in to comment.