mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 10:54:25 +02:00
Add PULL_LIMIT and PUSH_LIMIT to cron.update_mirror task (#17568)
This commit is contained in:
1 parent
9450410ff7
commit
188fd2dd1a
6 files changed
+70
-17
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user