diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index eab122b9..d2b00801 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -105,6 +105,8 @@ type cfg struct { cfgObject cfgObject profiler profiler.Profiler + + workers []worker } type cfgGRPC struct { diff --git a/cmd/neofs-node/main.go b/cmd/neofs-node/main.go index b496a851..f3ab7110 100644 --- a/cmd/neofs-node/main.go +++ b/cmd/neofs-node/main.go @@ -44,6 +44,7 @@ func bootUp(c *cfg) { serveProfiler(c) serveGRPC(c) bootstrapNode(c) + startWorkers(c) } func wait(c *cfg) { diff --git a/cmd/neofs-node/worker.go b/cmd/neofs-node/worker.go new file mode 100644 index 00000000..3d66cfc2 --- /dev/null +++ b/cmd/neofs-node/worker.go @@ -0,0 +1,20 @@ +package main + +import ( + "context" +) + +type worker interface { + Run(context.Context) +} + +func startWorkers(c *cfg) { + for _, wrk := range c.workers { + c.wg.Add(1) + + go func() { + wrk.Run(c.ctx) + c.wg.Done() + }() + } +}