parent
							
								
									59959ab222
								
							
						
					
					
						commit
						b75ad7b87f
					
				
					 4 changed files with 19 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -101,10 +101,11 @@ func GetPushMirrorsByRepoID(repoID int64) ([]*PushMirror, error) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
// PushMirrorsIterate iterates all push-mirror repositories.
 | 
			
		||||
func PushMirrorsIterate(f func(idx int, bean interface{}) error) error {
 | 
			
		||||
func PushMirrorsIterate(limit int, 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").
 | 
			
		||||
		Limit(limit).
 | 
			
		||||
		Iterate(new(PushMirror), f)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue