loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix missing migrate actions artifacts (#30874)

The actions artifacts should be able to be migrate to the new storage
place.

(cherry picked from commit 6ad77125cabe53a943d46b50e8cb79cfcea5491f)

authored by

Lunny Xiao and committed by
Earl Warren
7028fe0b 8cb85475

+16 -8
+16 -8
cmd/migrate_storage.go
··· 34 34 Name: "type", 35 35 Aliases: []string{"t"}, 36 36 Value: "", 37 - Usage: "Type of stored files to copy. Allowed types: 'attachments', 'lfs', 'avatars', 'repo-avatars', 'repo-archivers', 'packages', 'actions-log'", 37 + Usage: "Type of stored files to copy. Allowed types: 'attachments', 'lfs', 'avatars', 'repo-avatars', 'repo-archivers', 'packages', 'actions-log', 'actions-artifacts", 38 38 }, 39 39 &cli.StringFlag{ 40 40 Name: "storage", ··· 160 160 }) 161 161 } 162 162 163 + func migrateActionsArtifacts(ctx context.Context, dstStorage storage.ObjectStorage) error { 164 + return db.Iterate(ctx, nil, func(ctx context.Context, artifact *actions_model.ActionArtifact) error { 165 + _, err := storage.Copy(dstStorage, artifact.ArtifactPath, storage.ActionsArtifacts, artifact.ArtifactPath) 166 + return err 167 + }) 168 + } 169 + 163 170 func runMigrateStorage(ctx *cli.Context) error { 164 171 stdCtx, cancel := installSignals() 165 172 defer cancel() ··· 223 230 } 224 231 225 232 migratedMethods := map[string]func(context.Context, storage.ObjectStorage) error{ 226 - "attachments": migrateAttachments, 227 - "lfs": migrateLFS, 228 - "avatars": migrateAvatars, 229 - "repo-avatars": migrateRepoAvatars, 230 - "repo-archivers": migrateRepoArchivers, 231 - "packages": migratePackages, 232 - "actions-log": migrateActionsLog, 233 + "attachments": migrateAttachments, 234 + "lfs": migrateLFS, 235 + "avatars": migrateAvatars, 236 + "repo-avatars": migrateRepoAvatars, 237 + "repo-archivers": migrateRepoArchivers, 238 + "packages": migratePackages, 239 + "actions-log": migrateActionsLog, 240 + "actions-artifacts": migrateActionsArtifacts, 233 241 } 234 242 235 243 tp := strings.ToLower(ctx.String("type"))