From fd7d83ace60258acf7139c4c787aa8af75b7ba8c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 20 May 2022 22:08:52 +0800 Subject: Move almost all functions' parameter db.Engine to context.Context (#19748) * Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions --- services/repository/avatar.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'services/repository/avatar.go') diff --git a/services/repository/avatar.go b/services/repository/avatar.go index f51a312e17..dcf04c7e54 100644 --- a/services/repository/avatar.go +++ b/services/repository/avatar.go @@ -44,7 +44,7 @@ func UploadAvatar(repo *repo_model.Repository, data []byte) error { // Users can upload the same image to other repo - prefix it with ID // Then repo will be removed - only it avatar file will be removed repo.Avatar = newAvatar - if err := repo_model.UpdateRepositoryColsCtx(ctx, repo, "avatar"); err != nil { + if err := repo_model.UpdateRepositoryCols(ctx, repo, "avatar"); err != nil { return fmt.Errorf("UploadAvatar: Update repository avatar: %v", err) } @@ -83,7 +83,7 @@ func DeleteAvatar(repo *repo_model.Repository) error { defer committer.Close() repo.Avatar = "" - if err := repo_model.UpdateRepositoryColsCtx(ctx, repo, "avatar"); err != nil { + if err := repo_model.UpdateRepositoryCols(ctx, repo, "avatar"); err != nil { return fmt.Errorf("DeleteAvatar: Update repository avatar: %v", err) } @@ -117,5 +117,5 @@ func generateAvatar(ctx context.Context, templateRepo, generateRepo *repo_model. return err } - return repo_model.UpdateRepositoryColsCtx(ctx, generateRepo, "avatar") + return repo_model.UpdateRepositoryCols(ctx, generateRepo, "avatar") } -- cgit v1.2.3