From a145ec2f2b147b430eb5bc51b6ad0f1b9d8e2ac8 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 29 Dec 2022 16:19:25 +0800 Subject: [PATCH] fix: do not init actions service when disabled --- services/actions/actions.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/actions/actions.go b/services/actions/actions.go index c434f570ed..1a0ed4b55e 100644 --- a/services/actions/actions.go +++ b/services/actions/actions.go @@ -23,12 +23,14 @@ import ( ) func Init() { + if !setting.Actions.Enabled { + return + } + jobEmitterQueue = queue.CreateUniqueQueue("actions_ready_job", jobEmitterQueueHandle, new(jobUpdate)) 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 {