mirror of
https://github.com/go-gitea/gitea
synced 2025-07-14 14:37:20 +00:00
Mirror sync interval specified as duration string (#1407)
* Sync interval specifed as duration string * Changed mirror interval text * make fmt * Add MinInterval for mirror sync * Use duration internally * Changed min default to 10m * make fmt * Incorrect default * Removed defaults in MustDuration() * Add Mirror interval migration * Default values corrected * Use transaction during migration * Change http 500 to page with error message * Cleanup session.commit()
This commit is contained in:
@ -815,7 +815,7 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
|
||||
RepoID: repo.ID,
|
||||
Interval: setting.Mirror.DefaultInterval,
|
||||
EnablePrune: true,
|
||||
NextUpdate: time.Now().Add(time.Duration(setting.Mirror.DefaultInterval) * time.Hour),
|
||||
NextUpdate: time.Now().Add(setting.Mirror.DefaultInterval),
|
||||
}); err != nil {
|
||||
return repo, fmt.Errorf("InsertOne: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user