app/pluginservice: move plugin out from the Channels product (#21697)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-11-24 11:13:29 +03:00
коммит произвёл GitHub
родитель 5e5769c4ee
Коммит 6c55c4d356
31 изменённых файлов: 497 добавлений и 408 удалений

Просмотреть файл

@@ -143,6 +143,7 @@ type Server struct {
telemetryService *telemetry.TelemetryService
userService *users.UserService
teamService *teams.TeamService
pluginService *PluginService
serviceMux sync.RWMutex
remoteClusterService remotecluster.RemoteClusterServiceIFace
@@ -737,6 +738,10 @@ func (s *Server) Shutdown() {
}
}
// Stop the plugin service, we need to stop plugin service before stopping the
// product as products are being consumed by this service.
s.pluginService.ShutDownPlugins()
// Stop products.
// This needs to happen last because products are dependent
// on parent services.
@@ -843,11 +848,18 @@ func stripPort(hostport string) string {
func (s *Server) Start() error {
// Start products.
// This needs to happen before because products are dependent on the HTTP server.
// make sure channels starts first
if err := s.products["channels"].Start(); err != nil {
return errors.Wrap(err, "Unable to start channels")
}
// This should actually be started after products, but we have a product hooks
// dependency for now, once that get sorted out, this should be moved to the appropriate
// order.
if err := s.InitializePluginService(); err != nil {
return errors.Wrap(err, "Unable to start plugin service")
}
for name, product := range s.products {
if name == "channels" {
continue