[#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
|
@ -41,14 +41,14 @@ func (cmp *httpComponent) init(c *cfg) {
|
|||
c.workers = append(c.workers, worker{
|
||||
cmp.name,
|
||||
func(ctx context.Context) {
|
||||
runAndLog(c, cmp.name, false, func(c *cfg) {
|
||||
runAndLog(ctx, c, cmp.name, false, func(context.Context, *cfg) {
|
||||
fatalOnErr(srv.Serve())
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func (cmp *httpComponent) reload() error {
|
||||
func (cmp *httpComponent) reload(ctx context.Context) error {
|
||||
if cmp.preReload != nil {
|
||||
cmp.preReload(cmp.cfg)
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ func (cmp *httpComponent) reload() error {
|
|||
cmp.init(cmp.cfg)
|
||||
// Start worker
|
||||
if cmp.enabled {
|
||||
startWorker(cmp.cfg, *getWorker(cmp.cfg, cmp.name))
|
||||
startWorker(ctx, cmp.cfg, *getWorker(cmp.cfg, cmp.name))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue