mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-21 04:45:02 +02:00
chore: rename to Init
This commit is contained in:
parent
9b021500b0
commit
745be45e1b
@ -11,11 +11,18 @@ import (
|
||||
|
||||
"code.gitea.io/gitea/models/webhook"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/queue"
|
||||
|
||||
"github.com/nektos/act/pkg/model"
|
||||
)
|
||||
|
||||
func Init() {
|
||||
jobEmitterQueue = queue.CreateUniqueQueue("bots_ready_job", jobEmitterQueueHandle, new(jobUpdate))
|
||||
go graceful.GetManager().RunWithShutdownFns(jobEmitterQueue.Run)
|
||||
}
|
||||
|
||||
func ListWorkflows(commit *git.Commit) (git.Entries, error) {
|
||||
tree, err := commit.SubTree(".gitea/workflows")
|
||||
if _, ok := err.(git.ErrNotExist); ok {
|
||||
|
@ -23,11 +23,6 @@ type jobUpdate struct {
|
||||
RunID int64
|
||||
}
|
||||
|
||||
func InitJobEmitter() {
|
||||
jobEmitterQueue = queue.CreateUniqueQueue("bots_ready_job", jobEmitterQueueHandle, new(jobUpdate))
|
||||
go graceful.GetManager().RunWithShutdownFns(jobEmitterQueue.Run)
|
||||
}
|
||||
|
||||
func EmitJobsIfReady(runID int64) error {
|
||||
err := jobEmitterQueue.Push(&jobUpdate{
|
||||
RunID: runID,
|
||||
|
@ -175,7 +175,7 @@ func GlobalInitInstalled(ctx context.Context) {
|
||||
auth.Init()
|
||||
svg.Init()
|
||||
|
||||
bots.InitJobEmitter()
|
||||
bots.Init()
|
||||
|
||||
// Finally start up the cron
|
||||
cron.NewContext(ctx)
|
||||
|
@ -12,13 +12,14 @@ import (
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
runnerv1 "gitea.com/gitea/proto-go/runner/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
zombieTaskTimeout = 10 * time.Minute
|
||||
endlessTaskTimeout = 3 * time.Hour // the task is running for a long time with updates
|
||||
abandonedJobTimeout = 24 * time.Hour // the job is waiting for being picked by a runner
|
||||
endlessTaskTimeout = 3 * time.Hour
|
||||
abandonedJobTimeout = 24 * time.Hour
|
||||
)
|
||||
|
||||
// StopZombieTasks stops the task which have running status, but haven't been updated for a long time
|
||||
|
Loading…
x
Reference in New Issue
Block a user