Fix gitea doctor will remove repo-avatar files when execute command `storage-archives` (#30094)

Fix #30037
pull/30085/head^2
yp05327 8 months ago committed by GitHub
parent a4455d313e
commit 9cf0f0bb04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      services/doctor/storage.go

@ -162,7 +162,7 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
if opts.RepoArchives || opts.All { if opts.RepoArchives || opts.All {
if err := commonCheckStorage(ctx, logger, autofix, if err := commonCheckStorage(ctx, logger, autofix,
&commonStorageCheckOptions{ &commonStorageCheckOptions{
storer: storage.RepoAvatars, storer: storage.RepoArchives,
isOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) { isOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {
exists, err := repo.ExistsRepoArchiverWithStoragePath(ctx, path) exists, err := repo.ExistsRepoArchiverWithStoragePath(ctx, path)
if err == nil || errors.Is(err, util.ErrInvalidArgument) { if err == nil || errors.Is(err, util.ErrInvalidArgument) {

Loading…
Cancel
Save