Skip to content

Commit 8e93deb

Browse files
committed
Add Error Object when time is Less than Min Interval
1 parent 4348419 commit 8e93deb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/convert/repository.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,11 @@ func innerToRepo(repo *models.Repository, mode models.AccessMode, isParent bool)
9191

9292
numReleases, _ := models.GetReleaseCountByRepoID(repo.ID, models.FindReleasesOptions{IncludeDrafts: false, IncludeTags: true})
9393

94-
var mirrorInterval = ""
94+
mirrorInterval := ""
9595
if repo.IsMirror {
96-
if err := repo.GetMirror(); err != nil {
97-
return nil
96+
if err := repo.GetMirror(); err == nil {
97+
mirrorInterval = repo.Mirror.Interval.String()
9898
}
99-
mirrorInterval = repo.Mirror.Interval.String()
10099
}
101100

102101
return &api.Repository{

modules/repository/repo.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ func MigrateRepositoryGitData(ctx context.Context, u *models.User, repo *models.
135135
return repo, err
136136
}
137137
if interval != 0 && interval < setting.Mirror.MinInterval {
138-
log.Error("Interval is too frequent. %v", err)
138+
err := fmt.Errorf("Interval is set below Minimum Interval")
139+
log.Error("Interval is too frequent")
139140
return repo, err
140141
}
141142
}

0 commit comments

Comments
 (0)