1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Move some asymkey functions to service layer (#28894)

After the moving, all models will not depend on `util.Rename` so that I
can do next step refactoring.
This commit is contained in:
Lunny Xiao
2024-03-04 16:57:39 +08:00
committed by GitHub
parent c337ff0ec7
commit e2277d07ca
16 changed files with 176 additions and 140 deletions

View File

@@ -27,6 +27,7 @@ import (
"code.gitea.io/gitea/modules/lfs"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/storage"
asymkey_service "code.gitea.io/gitea/services/asymkey"
"xorm.io/builder"
)
@@ -277,7 +278,7 @@ func DeleteRepositoryDirectly(ctx context.Context, doer *user_model.User, repoID
committer.Close()
if needRewriteKeysFile {
if err := asymkey_model.RewriteAllPublicKeys(ctx); err != nil {
if err := asymkey_service.RewriteAllPublicKeys(ctx); err != nil {
log.Error("RewriteAllPublicKeys failed: %v", err)
}
}