aboutsummaryrefslogtreecommitdiffstats
path: root/services/packages/alpine
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-09-25 15:17:37 +0200
committerGitHub <noreply@github.com>2023-09-25 13:17:37 +0000
commit7047df36d4c39fefa6464b713c66302aa0038123 (patch)
treea5c471a3e8abf5cabac8de42c0fd8a814df7abf1 /services/packages/alpine
parent93bd4351bfb4a2f5f37ecb80d50496d044240e00 (diff)
downloadgitea-7047df36d4c39fefa6464b713c66302aa0038123.tar.gz
gitea-7047df36d4c39fefa6464b713c66302aa0038123.zip
Another round of `db.DefaultContext` refactor (#27103)
Part of #27065 --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'services/packages/alpine')
-rw-r--r--services/packages/alpine/repository.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/services/packages/alpine/repository.go b/services/packages/alpine/repository.go
index 24e673289a..eeda0cca7b 100644
--- a/services/packages/alpine/repository.go
+++ b/services/packages/alpine/repository.go
@@ -34,8 +34,8 @@ const IndexFilename = "APKINDEX.tar.gz"
// GetOrCreateRepositoryVersion gets or creates the internal repository package
// The Alpine registry needs multiple index files which are stored in this package.
-func GetOrCreateRepositoryVersion(ownerID int64) (*packages_model.PackageVersion, error) {
- return packages_service.GetOrCreateInternalPackageVersion(ownerID, packages_model.TypeAlpine, alpine_module.RepositoryPackage, alpine_module.RepositoryVersion)
+func GetOrCreateRepositoryVersion(ctx context.Context, ownerID int64) (*packages_model.PackageVersion, error) {
+ return packages_service.GetOrCreateInternalPackageVersion(ctx, ownerID, packages_model.TypeAlpine, alpine_module.RepositoryPackage, alpine_module.RepositoryVersion)
}
// GetOrCreateKeyPair gets or creates the RSA keys used to sign repository files
@@ -70,7 +70,7 @@ func GetOrCreateKeyPair(ctx context.Context, ownerID int64) (string, string, err
// BuildAllRepositoryFiles (re)builds all repository files for every available distributions, components and architectures
func BuildAllRepositoryFiles(ctx context.Context, ownerID int64) error {
- pv, err := GetOrCreateRepositoryVersion(ownerID)
+ pv, err := GetOrCreateRepositoryVersion(ctx, ownerID)
if err != nil {
return err
}
@@ -118,7 +118,7 @@ func BuildAllRepositoryFiles(ctx context.Context, ownerID int64) error {
// BuildSpecificRepositoryFiles builds index files for the repository
func BuildSpecificRepositoryFiles(ctx context.Context, ownerID int64, branch, repository, architecture string) error {
- pv, err := GetOrCreateRepositoryVersion(ownerID)
+ pv, err := GetOrCreateRepositoryVersion(ctx, ownerID)
if err != nil {
return err
}
@@ -290,6 +290,7 @@ func buildPackagesIndex(ctx context.Context, ownerID int64, repoVersion *package
}
_, err = packages_service.AddFileToPackageVersionInternal(
+ ctx,
repoVersion,
&packages_service.PackageFileCreationInfo{
PackageFileInfo: packages_service.PackageFileInfo{