summaryrefslogtreecommitdiffstats
path: root/modules/task
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-12-17 12:16:54 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-12-16 23:16:54 -0500
commitffc904b1e0635d17e55b5fbdea4e18832ee2276d (patch)
tree209691d128fb2e23476e0b1ac67c51c6f5b693de /modules/task
parentd1a49977b089afefc40172711d02eb795d2234de (diff)
downloadgitea-ffc904b1e0635d17e55b5fbdea4e18832ee2276d.tar.gz
gitea-ffc904b1e0635d17e55b5fbdea4e18832ee2276d.zip
Sleep longer if request speed is over github limitation (#9335)
* Sleep longer if request speed is over github limitation * improve code * remove unused code * fix lint * Use github's rate limit remain value to determine how long to sleep * Save reset time when finished github api request * fix bug * fix lint * Add context.Context for sleep * fix test * improve code * fix bug and lint * fix import order
Diffstat (limited to 'modules/task')
-rw-r--r--modules/task/migrate.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/task/migrate.go b/modules/task/migrate.go
index 247403d7be..d3b4fa45f0 100644
--- a/modules/task/migrate.go
+++ b/modules/task/migrate.go
@@ -11,6 +11,7 @@ import (
"strings"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/migrations"
"code.gitea.io/gitea/modules/notification"
@@ -95,7 +96,7 @@ func runMigrateTask(t *models.Task) (err error) {
}
opts.MigrateToRepoID = t.RepoID
- repo, err := migrations.MigrateRepository(t.Doer, t.Owner.Name, *opts)
+ repo, err := migrations.MigrateRepository(graceful.GetManager().HammerContext(), t.Doer, t.Owner.Name, *opts)
if err == nil {
log.Trace("Repository migrated [%d]: %s/%s", repo.ID, t.Owner.Name, repo.Name)
return nil