aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-11-23 03:09:35 +0000
committerGitHub <noreply@github.com>2021-11-22 22:09:35 -0500
commit188fd2dd1a778ad140a569b31d2bf6c95e2a6bae (patch)
tree9e10531fbeaf7df945b0d10e3ffce620d3d6d696 /models
parent9450410ff71db5c6076fbe72e4b47fc9798b8d14 (diff)
downloadgitea-188fd2dd1a778ad140a569b31d2bf6c95e2a6bae.tar.gz
gitea-188fd2dd1a778ad140a569b31d2bf6c95e2a6bae.zip
Add `PULL_LIMIT` and `PUSH_LIMIT` to cron.update_mirror task (#17568)
Diffstat (limited to 'models')
-rw-r--r--models/repo_mirror.go1
-rw-r--r--models/repo_pushmirror.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/models/repo_mirror.go b/models/repo_mirror.go
index 35685b3220..e28d0d2517 100644
--- a/models/repo_mirror.go
+++ b/models/repo_mirror.go
@@ -119,6 +119,7 @@ func MirrorsIterate(f func(idx int, bean interface{}) error) error {
return db.GetEngine(db.DefaultContext).
Where("next_update_unix<=?", time.Now().Unix()).
And("next_update_unix!=0").
+ OrderBy("updated_unix ASC").
Iterate(new(Mirror), f)
}
diff --git a/models/repo_pushmirror.go b/models/repo_pushmirror.go
index c6207bae6d..38a1a66947 100644
--- a/models/repo_pushmirror.go
+++ b/models/repo_pushmirror.go
@@ -107,5 +107,6 @@ func PushMirrorsIterate(f func(idx int, bean interface{}) error) error {
return db.GetEngine(db.DefaultContext).
Where("last_update + (`interval` / ?) <= ?", time.Second, time.Now().Unix()).
And("`interval` != 0").
+ OrderBy("last_update ASC").
Iterate(new(PushMirror), f)
}