diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index eab122b9df..d2b008011b 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 b496a85161..f3ab711042 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 0000000000..3d66cfc280 --- /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() + }() + } +}