forked from TrueCloudLab/frostfs-node
[#168] node: Refactor node config
Resolve containedctx linter for cfg Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
8426d25f4b
commit
a7c79c773a
20 changed files with 93 additions and 83 deletions
|
@ -15,17 +15,17 @@ func newWorkerFromFunc(fn func(ctx context.Context)) worker {
|
|||
}
|
||||
}
|
||||
|
||||
func startWorkers(c *cfg) {
|
||||
func startWorkers(ctx context.Context, c *cfg) {
|
||||
for _, wrk := range c.workers {
|
||||
startWorker(c, wrk)
|
||||
startWorker(ctx, c, wrk)
|
||||
}
|
||||
}
|
||||
|
||||
func startWorker(c *cfg, wrk worker) {
|
||||
func startWorker(ctx context.Context, c *cfg, wrk worker) {
|
||||
c.wg.Add(1)
|
||||
|
||||
go func(w worker) {
|
||||
w.fn(c.ctx)
|
||||
w.fn(ctx)
|
||||
c.wg.Done()
|
||||
}(wrk)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue