diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index eab122b9d..d2b008011 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 b496a8516..f3ab71104 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 000000000..3d66cfc28 --- /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() + }() + } +}