diff options
author | Valery Piashchynski <[email protected]> | 2023-01-06 13:49:04 +0100 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2023-01-06 13:49:04 +0100 |
commit | 3bb4d3a497b609557e884ec29a94c204dfac86a2 (patch) | |
tree | 79efa8e3a9fdb626462a5236265c298f36f77e2e /lib/roadrunner.go | |
parent | f6bc8835dc4d996992b6d4a2751ac10dc6138e4f (diff) |
Initial support for the endure v2 container
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'lib/roadrunner.go')
-rw-r--r-- | lib/roadrunner.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/roadrunner.go b/lib/roadrunner.go index 8a505c3f..d500dc66 100644 --- a/lib/roadrunner.go +++ b/lib/roadrunner.go @@ -5,8 +5,7 @@ import ( "runtime/debug" configImpl "github.com/roadrunner-server/config/v3" - endure "github.com/roadrunner-server/endure/pkg/container" - "github.com/roadrunner-server/endure/pkg/fsm" + "github.com/roadrunner-server/endure/v2" "github.com/roadrunner-server/roadrunner/v2/container" ) @@ -38,11 +37,16 @@ func NewRR(cfgFile string, override []string, pluginList []any) (*RR, error) { } // create endure container - endureContainer, err := container.NewContainer(*containerCfg) - if err != nil { - return nil, err + endureOptions := []endure.Options{ + endure.GracefulShutdownTimeout(containerCfg.GracePeriod), } + if containerCfg.PrintGraph { + endureOptions = append(endureOptions, endure.Visualize()) + } + + endureContainer := endure.New(containerCfg.LogLevel, endureOptions...) + // register another container plugins err = endureContainer.RegisterAll(append(pluginList, cfg)...) if err != nil { @@ -79,8 +83,8 @@ func (rr *RR) Serve() error { } } -func (rr *RR) CurrentState() fsm.State { - return rr.container.CurrentState() +func (rr *RR) Plugins() []string { + return rr.container.Plugins() } // Stop stops roadrunner |