Skip to content

Commit

Permalink
修改插件初始化回调
Browse files Browse the repository at this point in the history
  • Loading branch information
pangdogs committed Apr 21, 2023
1 parent 90275d0 commit ad30f01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lifecycle_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
)

type _ServicePluginInit interface {
Init(ctx service.Context)
InitService(ctx service.Context)
}

type _RuntimePluginInit interface {
Init(ctx runtime.Context)
InitRuntime(ctx runtime.Context)
}

type _PluginShut interface {
Expand Down
2 changes: 1 addition & 1 deletion runtime_running.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (_runtime *RuntimeBehavior) running(shutChan chan struct{}) {
pluginBundle.Range(func(pluginName string, pluginFace util.FaceAny) bool {
if pluginInit, ok := pluginFace.Iface.(_RuntimePluginInit); ok {
internal.CallOuterNoRet(_runtime.ctx.GetAutoRecover(), _runtime.ctx.GetReportError(), func() {
pluginInit.Init(_runtime.ctx)
pluginInit.InitRuntime(_runtime.ctx)
})
}
return true
Expand Down
2 changes: 1 addition & 1 deletion service_running.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (_service *ServiceBehavior) running(shutChan chan struct{}) {
pluginBundle.Range(func(pluginName string, pluginFace util.FaceAny) bool {
if pluginInit, ok := pluginFace.Iface.(_ServicePluginInit); ok {
internal.CallOuterNoRet(_service.ctx.GetAutoRecover(), _service.ctx.GetReportError(), func() {
pluginInit.Init(_service.ctx)
pluginInit.InitService(_service.ctx)
})
}
return true
Expand Down

0 comments on commit ad30f01

Please sign in to comment.