diff options
author | Valery Piashchynski <[email protected]> | 2020-10-19 14:01:59 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-10-19 14:01:59 +0300 |
commit | 77670fb7af0c892c9b3a589fd424534fad288e7a (patch) | |
tree | 3adcaa85db664a355abe2b28f1d7e4a3fc45689f /plugins/factory/factory.go | |
parent | 16fbf3104c3c34bd9355593052b686acd26a8efe (diff) |
Update according activity worker
Diffstat (limited to 'plugins/factory/factory.go')
-rw-r--r-- | plugins/factory/factory.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/factory/factory.go b/plugins/factory/factory.go index c5490cd6..5d80682d 100644 --- a/plugins/factory/factory.go +++ b/plugins/factory/factory.go @@ -3,9 +3,11 @@ package factory import ( "context" - "github.com/spiral/roadrunner/v2/plugins/events" + "log" + "github.com/fatih/color" "github.com/spiral/roadrunner/v2" + "github.com/spiral/roadrunner/v2/plugins/events" ) type WorkerFactory interface { @@ -23,6 +25,7 @@ func (wf *WFactory) NewWorkerPool(ctx context.Context, opt *roadrunner.Config, e if err != nil { return nil, err } + factory, err := wf.spw.NewFactory(env) if err != nil { return nil, err @@ -37,6 +40,11 @@ func (wf *WFactory) NewWorkerPool(ctx context.Context, opt *roadrunner.Config, e go func() { for e := range p.Events() { wf.eb.Push(e) + if we, ok := e.Payload.(roadrunner.WorkerEvent); ok { + if we.Event == roadrunner.EventWorkerLog { + log.Print(color.YellowString(string(we.Payload.([]byte)))) + } + } } }() |