Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Jun 5, 2022
1 parent 6310dfd commit 62dd4d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions models/repo/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func MirrorsIterate(limit int, f func(idx int, bean interface{}) error) error {
}

// InsertMirror inserts a mirror to database
func InsertMirror(mirror *Mirror) error {
_, err := db.GetEngine(db.DefaultContext).Insert(mirror)
func InsertMirror(ctx context.Context, mirror *Mirror) error {
_, err := db.GetEngine(ctx).Insert(mirror)
return err
}

Expand Down
2 changes: 1 addition & 1 deletion modules/repository/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
}
}

if err = repo_model.InsertMirror(&mirrorModel); err != nil {
if err = repo_model.InsertMirror(ctx, &mirrorModel); err != nil {
return repo, fmt.Errorf("InsertOne: %v", err)
}

Expand Down

0 comments on commit 62dd4d8

Please sign in to comment.