1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-27 04:38:36 +00:00

fix: do not init actions service when disabled

This commit is contained in:
Jason Song
2022-12-29 16:19:25 +08:00
parent 5ae2816ac4
commit a145ec2f2b

View File

@@ -23,13 +23,15 @@ import (
) )
func Init() { func Init() {
if !setting.Actions.Enabled {
return
}
jobEmitterQueue = queue.CreateUniqueQueue("actions_ready_job", jobEmitterQueueHandle, new(jobUpdate)) jobEmitterQueue = queue.CreateUniqueQueue("actions_ready_job", jobEmitterQueueHandle, new(jobUpdate))
go graceful.GetManager().RunWithShutdownFns(jobEmitterQueue.Run) go graceful.GetManager().RunWithShutdownFns(jobEmitterQueue.Run)
if setting.Actions.Enabled {
notification.RegisterNotifier(NewNotifier()) notification.RegisterNotifier(NewNotifier())
} }
}
func DeleteResourceOfRepository(ctx context.Context, repo *repo_model.Repository) error { func DeleteResourceOfRepository(ctx context.Context, repo *repo_model.Repository) error {
tasks, _, err := actions_model.FindTasks(ctx, actions_model.FindTaskOptions{RepoID: repo.ID}) tasks, _, err := actions_model.FindTasks(ctx, actions_model.FindTaskOptions{RepoID: repo.ID})