-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only check for non-finished migrating task #19601
Conversation
Gusted
commented
May 3, 2022
- Only check if a non-finished migrating task exists for a mirror before fetching the mirror details from the database.
- Resolves 500 Internal Server Error when accessing settings for mirror #19600
- Regression: Don't fetch Mirror when it's migrating #19588
- Only check if a non-finished migrating task exists for a mirror before fetching the mirror details from the database. - Resolves go-gitea#19600 - Regression: go-gitea#19588
// HasFinishedMigratingTask returns if a finished migration task exists for the repo. | ||
func HasFinishedMigratingTask(repoID int64) (bool, error) { | ||
return db.GetEngine(db.DefaultContext). | ||
Where("repo_id=? AND type=? AND status=?", repoID, structs.TaskTypeMigrateRepo, structs.TaskStatusFinished). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where("repo_id=? AND type=? AND status=?", repoID, structs.TaskTypeMigrateRepo, structs.TaskStatusFinished). | |
Where("repo_id=? AND type=? AND status<>?", repoID, structs.TaskTypeMigrateRepo, structs.TaskStatusRunning). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or how should failed migrations be handled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed migrations don't have a any information in the Mirror table.
* giteaofficial/main: Add health check endpoint (go-gitea#18465) Only check for non-finished migrating task (go-gitea#19601) Make .cs highlighting legible on dark themes. (go-gitea#19604)
* 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 go-gitea#19600 - Regression: go-gitea#19588 * Clarify function