add error to plugin start.

This commit is contained in:
Maksim Dorokhin 2022-04-20 09:31:37 +00:00
parent 61059c9b3c
commit ae7e6dc2d7
2 changed files with 5 additions and 3 deletions

View File

@ -94,13 +94,15 @@ func (manager *ManagerCtx) Start(
webSocketManager types.WebSocketManager,
apiManager types.ApiManager,
) {
for _, plug := range manager.plugins {
plug.Start(types.PluginManagers{
for path, plug := range manager.plugins {
err := plug.Start(types.PluginManagers{
SessionManager: sessionManager,
WebSocketManager: webSocketManager,
ApiManager: apiManager,
LoadServiceFromPlugin: manager.LookupService,
})
manager.logger.Err(err).Str("plugin", path).Msg("plugin start")
}
}

View File

@ -9,7 +9,7 @@ import (
type Plugin interface {
Name() string
Config() PluginConfig
Start(PluginManagers)
Start(PluginManagers) error
Shutdown() error
}