mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Only check for non-finished migrating task (#19601)
* Only check for non-finished migrating task - Only check if a non-finished migrating task exists for a mirror before fetching the mirror details from the database. - Resolves #19600 - Regression: #19588 * Clarify function
This commit is contained in:
@ -371,14 +371,14 @@ func repoAssignment(ctx *Context, repo *repo_model.Repository) {
|
||||
|
||||
if repo.IsMirror {
|
||||
|
||||
// Check if there's a migrating task.
|
||||
// If it does exist, don't fetch the Mirror from the database as it doesn't exist yet.
|
||||
hasTask, err := models.HasMigratingTask(repo.ID)
|
||||
// Check if the mirror has finsihed migrationg, only then we can
|
||||
// lookup the mirror informtation the database.
|
||||
finishedMigrating, err := models.HasFinishedMigratingTask(repo.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetMirrorByRepoID", err)
|
||||
ctx.ServerError("HasFinishedMigratingTask", err)
|
||||
return
|
||||
}
|
||||
if !hasTask {
|
||||
if finishedMigrating {
|
||||
ctx.Repo.Mirror, err = repo_model.GetMirrorByRepoID(repo.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetMirrorByRepoID", err)
|
||||
|
Reference in New Issue
Block a user