forked from forgejo/forgejo
Add Retry
button when creating a mirror-repo fails (#26228)
fixed #26156 * Added a retry button in the frontend (only displayed when the status is abnormal) * After clicking Retry, the backend adds the task back to the task queue   --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
907bedaad0
commit
865d2221c0
6 changed files with 57 additions and 4 deletions
|
@ -259,6 +259,15 @@ func setMigrationContextData(ctx *context.Context, serviceType structs.GitServic
|
|||
ctx.Data["service"] = serviceType
|
||||
}
|
||||
|
||||
func MigrateRetryPost(ctx *context.Context) {
|
||||
if err := task.RetryMigrateTask(ctx.Repo.Repository.ID); err != nil {
|
||||
log.Error("Retry task failed: %v", err)
|
||||
ctx.ServerError("task.RetryMigrateTask", err)
|
||||
return
|
||||
}
|
||||
ctx.JSONOK()
|
||||
}
|
||||
|
||||
func MigrateCancelPost(ctx *context.Context) {
|
||||
migratingTask, err := admin_model.GetMigratingTask(ctx.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue