Skip to content

Commit 4ae6b1a

Browse files
authored
Remove unused parameter for some functions in services/mirror (#30724)
Suggested by gopls `unusedparams`
1 parent 9b2536b commit 4ae6b1a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

services/mirror/mirror.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error {
4040
}
4141
log.Trace("Doing: Update")
4242

43-
handler := func(idx int, bean any) error {
43+
handler := func(bean any) error {
4444
var repo *repo_model.Repository
4545
var mirrorType SyncType
4646
var referenceID int64
@@ -91,7 +91,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error {
9191
pullMirrorsRequested := 0
9292
if pullLimit != 0 {
9393
if err := repo_model.MirrorsIterate(ctx, pullLimit, func(idx int, bean any) error {
94-
if err := handler(idx, bean); err != nil {
94+
if err := handler(bean); err != nil {
9595
return err
9696
}
9797
pullMirrorsRequested++
@@ -105,7 +105,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error {
105105
pushMirrorsRequested := 0
106106
if pushLimit != 0 {
107107
if err := repo_model.PushMirrorsIterate(ctx, pushLimit, func(idx int, bean any) error {
108-
if err := handler(idx, bean); err != nil {
108+
if err := handler(bean); err != nil {
109109
return err
110110
}
111111
pushMirrorsRequested++

services/mirror/mirror_pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ func SyncPullMirror(ctx context.Context, repoID int64) bool {
466466

467467
log.Trace("SyncMirrors [repo: %-v]: %d branches updated", m.Repo, len(results))
468468
if len(results) > 0 {
469-
if ok := checkAndUpdateEmptyRepository(ctx, m, gitRepo, results); !ok {
469+
if ok := checkAndUpdateEmptyRepository(ctx, m, results); !ok {
470470
log.Error("SyncMirrors [repo: %-v]: checkAndUpdateEmptyRepository: %v", m.Repo, err)
471471
return false
472472
}
@@ -564,7 +564,7 @@ func SyncPullMirror(ctx context.Context, repoID int64) bool {
564564
return true
565565
}
566566

567-
func checkAndUpdateEmptyRepository(ctx context.Context, m *repo_model.Mirror, gitRepo *git.Repository, results []*mirrorSyncResult) bool {
567+
func checkAndUpdateEmptyRepository(ctx context.Context, m *repo_model.Mirror, results []*mirrorSyncResult) bool {
568568
if !m.Repo.IsEmpty {
569569
return true
570570
}

0 commit comments

Comments
 (0)