mirror of
https://github.com/go-gitea/gitea
synced 2025-08-07 01:58:19 +00:00
Move some pull request functions from models to services (#9266)
* Move some pull request functions from models to services * Fix test
This commit is contained in:
committed by
techknowlogick
parent
1583c48e3a
commit
82e0383d21
@@ -26,6 +26,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/webhook"
|
||||
"code.gitea.io/gitea/services/mailer"
|
||||
mirror_service "code.gitea.io/gitea/services/mirror"
|
||||
pull_service "code.gitea.io/gitea/services/pull"
|
||||
|
||||
"gitea.com/macaron/macaron"
|
||||
)
|
||||
@@ -104,7 +105,7 @@ func GlobalInit() {
|
||||
models.InitRepoIndexer()
|
||||
mirror_service.InitSyncMirrors()
|
||||
webhook.InitDeliverHooks()
|
||||
models.InitTestPullRequests()
|
||||
pull_service.Init()
|
||||
if err := task.Init(); err != nil {
|
||||
log.Fatal("Failed to initialize task scheduler: %v", err)
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
comment_service "code.gitea.io/gitea/services/comments"
|
||||
issue_service "code.gitea.io/gitea/services/issue"
|
||||
pull_service "code.gitea.io/gitea/services/pull"
|
||||
|
||||
"github.com/unknwon/com"
|
||||
)
|
||||
@@ -1272,7 +1273,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||
return
|
||||
}
|
||||
|
||||
issue.PullRequest.AddToTaskQueue()
|
||||
pull_service.AddToTaskQueue(issue.PullRequest)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user