From f31380f5773c6cea2d6434fb656d012d5cc9b866 Mon Sep 17 00:00:00 2001 From: Ibrahim Serdar Acikgoz Date: Thu, 15 Dec 2022 12:29:33 +0300 Subject: [PATCH] product/hooks: hooks service no longer requires channels service start (#21861) --- app/channels.go | 4 ---- product/api.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/channels.go b/app/channels.go index 31eca3a2ea..513b02be08 100644 --- a/app/channels.go +++ b/app/channels.go @@ -325,10 +325,6 @@ type hooksService struct { } func (s *hooksService) RegisterHooks(productID string, hooks any) error { - if s.ch.pluginsEnvironment == nil { - return errors.New("could not find plugins environment") - } - return s.ch.srv.hooksManager.AddProduct(productID, hooks) } diff --git a/product/api.go b/product/api.go index 88eb9744e4..5067c20ce9 100644 --- a/product/api.go +++ b/product/api.go @@ -112,7 +112,7 @@ type ConfigService interface { } // HooksService is the API for adding exiting plugin hooks to the server so that they can be called as -// they were. This Service is required to be used after the products start. Otherwise it will return an error. +// they were. This Service is required to be accessed after the channels product initialized. // // The service shall be registered via app.HooksKey service key. type HooksService interface {