aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
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 /cmd
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 'cmd')
-rw-r--r--cmd/admin.go4
-rw-r--r--cmd/migrate_storage_test.go3
2 files changed, 4 insertions, 3 deletions
diff --git a/cmd/admin.go b/cmd/admin.go
index a4f48b0513..d49dcf13cb 100644
--- a/cmd/admin.go
+++ b/cmd/admin.go
@@ -389,7 +389,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
}
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
- if err = repo_module.SyncReleasesWithTags(repo, gitRepo); err != nil {
+ if err = repo_module.SyncReleasesWithTags(ctx, repo, gitRepo); err != nil {
log.Warn(" SyncReleasesWithTags: %v", err)
gitRepo.Close()
continue
@@ -438,7 +438,7 @@ func runRegenerateKeys(_ *cli.Context) error {
if err := initDB(ctx); err != nil {
return err
}
- return asymkey_model.RewriteAllPublicKeys()
+ return asymkey_model.RewriteAllPublicKeys(ctx)
}
func parseOAuth2Config(c *cli.Context) *oauth2.Source {
diff --git a/cmd/migrate_storage_test.go b/cmd/migrate_storage_test.go
index 644e0dc18b..5d8c867993 100644
--- a/cmd/migrate_storage_test.go
+++ b/cmd/migrate_storage_test.go
@@ -9,6 +9,7 @@ import (
"strings"
"testing"
+ "code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/packages"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
@@ -30,7 +31,7 @@ func TestMigratePackages(t *testing.T) {
assert.NoError(t, err)
defer buf.Close()
- v, f, err := packages_service.CreatePackageAndAddFile(&packages_service.PackageCreationInfo{
+ v, f, err := packages_service.CreatePackageAndAddFile(db.DefaultContext, &packages_service.PackageCreationInfo{
PackageInfo: packages_service.PackageInfo{
Owner: creator,
PackageType: packages.TypeGeneric,