diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-01-15 10:19:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-15 02:19:25 +0000 |
commit | 70c4aad8e1cbc46b049b015dcd6f2e5be5a69e72 (patch) | |
tree | 5c9f049437c1a84a402aeef3be0cb4b95dea667e /services/convert | |
parent | e5313248a8ed967a915f072d3991b6d046badf02 (diff) | |
download | gitea-70c4aad8e1cbc46b049b015dcd6f2e5be5a69e72.tar.gz gitea-70c4aad8e1cbc46b049b015dcd6f2e5be5a69e72.zip |
Move more functions to db.Find (#28419)
Following #28220
This PR move more functions to use `db.Find`.
---------
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'services/convert')
-rw-r--r-- | services/convert/repository.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/convert/repository.go b/services/convert/repository.go index 71038cd062..c16180c0af 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -8,6 +8,7 @@ import ( "time" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/perm" access_model "code.gitea.io/gitea/models/perm/access" repo_model "code.gitea.io/gitea/models/repo" @@ -133,7 +134,11 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR return nil } - numReleases, _ := repo_model.GetReleaseCountByRepoID(ctx, repo.ID, repo_model.FindReleasesOptions{IncludeDrafts: false, IncludeTags: false}) + numReleases, _ := db.Count[repo_model.Release](ctx, repo_model.FindReleasesOptions{ + IncludeDrafts: false, + IncludeTags: false, + RepoID: repo.ID, + }) mirrorInterval := "" var mirrorUpdated time.Time |