From d8f5330c290ea3b2aff4db46ea89eff9374f38d7 Mon Sep 17 00:00:00 2001 From: laser Date: Mon, 3 Feb 2020 15:46:24 -0800 Subject: [PATCH] don't consume short-lived context --- node/modules/storageminer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 127c68d0d..dfeec2398 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -104,7 +104,9 @@ func StorageMiner(mctx helpers.MetricsCtx, lc fx.Lifecycle, api api.FullNode, h return nil, err } - worker, err := api.StateMinerWorker(helpers.LifecycleCtx(mctx, lc), maddr, nil) + ctx := helpers.LifecycleCtx(mctx, lc) + + worker, err := api.StateMinerWorker(ctx, maddr, nil) if err != nil { return nil, err } @@ -117,7 +119,7 @@ func StorageMiner(mctx helpers.MetricsCtx, lc fx.Lifecycle, api api.FullNode, h } lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { + OnStart: func(context.Context) error { go fps.Run(ctx) return sm.Run(ctx) },