Fix bug of migrated repository not index (#16991)

Fix #16986, #16152
tokarchuk/v1.17
Lunny Xiao 3 years ago committed by GitHub
parent 1b922374db
commit efdbba4453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      modules/task/migrate.go

@ -93,7 +93,6 @@ func runMigrateTask(t *models.Task) (err error) {
} }
opts.MigrateToRepoID = t.RepoID opts.MigrateToRepoID = t.RepoID
var repo *models.Repository
ctx, cancel := context.WithCancel(graceful.GetManager().ShutdownContext()) ctx, cancel := context.WithCancel(graceful.GetManager().ShutdownContext())
defer cancel() defer cancel()
@ -107,7 +106,7 @@ func runMigrateTask(t *models.Task) (err error) {
return return
} }
repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts, func(format string, args ...interface{}) { t.Repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts, func(format string, args ...interface{}) {
message := models.TranslatableMessage{ message := models.TranslatableMessage{
Format: format, Format: format,
Args: args, Args: args,
@ -117,7 +116,7 @@ func runMigrateTask(t *models.Task) (err error) {
_ = t.UpdateCols("message") _ = t.UpdateCols("message")
}) })
if err == nil { if err == nil {
log.Trace("Repository migrated [%d]: %s/%s", repo.ID, t.Owner.Name, repo.Name) log.Trace("Repository migrated [%d]: %s/%s", t.Repo.ID, t.Owner.Name, t.Repo.Name)
return return
} }

Loading…
Cancel
Save