chore: move job emitter to service

This commit is contained in:
Jason Song
2022-11-18 11:43:42 +08:00
parent f57e6999a2
commit dd417a3270
6 changed files with 19 additions and 10 deletions

15
services/bots/bots.go Normal file
View File

@ -0,0 +1,15 @@
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package bots
import (
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/queue"
)
func Init() {
jobEmitterQueue = queue.CreateUniqueQueue("bots_ready_job", jobEmitterQueueHandle, new(jobUpdate))
go graceful.GetManager().RunWithShutdownFns(jobEmitterQueue.Run)
}