Remove unnecessary goroutine (#16080)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
tokarchuk/v1.17
Lunny Xiao 4 years ago committed by GitHub
parent fb3ffeb18d
commit 5fef041079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      services/pull/check.go

@ -28,7 +28,6 @@ var prQueue queue.UniqueQueue
// AddToTaskQueue adds itself to pull request test task queue. // AddToTaskQueue adds itself to pull request test task queue.
func AddToTaskQueue(pr *models.PullRequest) { func AddToTaskQueue(pr *models.PullRequest) {
go func() {
err := prQueue.PushFunc(strconv.FormatInt(pr.ID, 10), func() error { err := prQueue.PushFunc(strconv.FormatInt(pr.ID, 10), func() error {
pr.Status = models.PullRequestStatusChecking pr.Status = models.PullRequestStatusChecking
err := pr.UpdateColsIfNotMerged("status") err := pr.UpdateColsIfNotMerged("status")
@ -42,7 +41,6 @@ func AddToTaskQueue(pr *models.PullRequest) {
if err != nil && err != queue.ErrAlreadyInQueue { if err != nil && err != queue.ErrAlreadyInQueue {
log.Error("Error adding prID %d to the test pull requests queue: %v", pr.ID, err) log.Error("Error adding prID %d to the test pull requests queue: %v", pr.ID, err)
} }
}()
} }
// checkAndUpdateStatus checks if pull request is possible to leaving checking status, // checkAndUpdateStatus checks if pull request is possible to leaving checking status,

Loading…
Cancel
Save