From 7576e37a65729363370d6672ff6e69e87b68ac5f Mon Sep 17 00:00:00 2001 From: Paul Barton <28630076+paulbarton90@users.noreply.github.com> Date: Sat, 2 Jan 2021 23:47:47 +0000 Subject: Add MirrorInterval to the API (#14163) * Added MirrorInterval to the API * Remove MirrorInterval from CreateRepository * Removed Duplicate UpdateMirror Function * Updated Error Logging * Update Log Message for is not Mirror Co-authored-by: 6543 <6543@obermui.de> * Delete Debug Statement that snuck in Co-authored-by: zeripath * Add Check for If Interval is too small * Output to API Call * Add Error Object when time is Less than Min Interval * Frequency Error Message Co-authored-by: zeripath * Allow Zero Mirror Interval Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath --- modules/migrations/base/options.go | 1 + modules/migrations/gitea_uploader.go | 1 + 2 files changed, 2 insertions(+) (limited to 'modules/migrations') diff --git a/modules/migrations/base/options.go b/modules/migrations/base/options.go index 3c9b2c22fc..168f9848c8 100644 --- a/modules/migrations/base/options.go +++ b/modules/migrations/base/options.go @@ -33,4 +33,5 @@ type MigrateOptions struct { PullRequests bool ReleaseAssets bool MigrateToRepoID int64 + MirrorInterval string `json:"mirror_interval"` } diff --git a/modules/migrations/gitea_uploader.go b/modules/migrations/gitea_uploader.go index 6118b3b5c1..2c79bd4b0f 100644 --- a/modules/migrations/gitea_uploader.go +++ b/modules/migrations/gitea_uploader.go @@ -142,6 +142,7 @@ func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.Migrate Private: repo.IsPrivate, Wiki: opts.Wiki, Releases: opts.Releases, // if didn't get releases, then sync them from tags + MirrorInterval: opts.MirrorInterval, }) g.repo = r -- cgit v1.2.3