From 7fc09959619e9e400ecafcffcd63e38812f397a6 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 23 Jun 2021 15:02:16 +0300 Subject: - Swithc from value to pointer to the pool configuration. Interface value changed. Signed-off-by: Valery Piashchynski --- plugins/http/plugin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/http/plugin.go') diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go index bec01ac3..fb174792 100644 --- a/plugins/http/plugin.go +++ b/plugins/http/plugin.go @@ -143,7 +143,7 @@ func (p *Plugin) Serve() chan error { func (p *Plugin) serve(errCh chan error) { var err error const op = errors.Op("http_plugin_serve") - p.pool, err = p.server.NewWorkerPool(context.Background(), pool.Config{ + p.pool, err = p.server.NewWorkerPool(context.Background(), &pool.Config{ Debug: p.cfg.Pool.Debug, NumWorkers: p.cfg.Pool.NumWorkers, MaxJobs: p.cfg.Pool.MaxJobs, @@ -323,7 +323,7 @@ func (p *Plugin) Reset() error { p.pool = nil var err error - p.pool, err = p.server.NewWorkerPool(context.Background(), pool.Config{ + p.pool, err = p.server.NewWorkerPool(context.Background(), &pool.Config{ Debug: p.cfg.Pool.Debug, NumWorkers: p.cfg.Pool.NumWorkers, MaxJobs: p.cfg.Pool.MaxJobs, -- cgit v1.2.3 From 589f759cc2411319adbca2ece0dbe212407d1eba Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Sun, 11 Jul 2021 10:11:22 +0300 Subject: Update informer interface to return slice of pointers (do not over-copy the Stat structure). Make amqp Push concurrent safe. Signed-off-by: Valery Piashchynski --- plugins/http/plugin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/http/plugin.go') diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go index fb174792..2ee83384 100644 --- a/plugins/http/plugin.go +++ b/plugins/http/plugin.go @@ -285,13 +285,13 @@ func (p *Plugin) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // Workers returns slice with the process states for the workers -func (p *Plugin) Workers() []process.State { +func (p *Plugin) Workers() []*process.State { p.RLock() defer p.RUnlock() workers := p.workers() - ps := make([]process.State, 0, len(workers)) + ps := make([]*process.State, 0, len(workers)) for i := 0; i < len(workers); i++ { state, err := process.WorkerProcessState(workers[i]) if err != nil { -- cgit v1.2.3