From f12e38b70e43b8dc23170de498e78a8235eb2851 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 21 Dec 2020 15:47:20 +0800 Subject: [PATCH] call cancelTrading defer --- pkg/cmd/run.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index f4ade37a9..3774b16b9 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -73,6 +73,7 @@ func compileRunFile(filepath string, config *bbgo.Config) error { func runConfig(basectx context.Context, userConfig *bbgo.Config) error { ctx, cancelTrading := context.WithCancel(basectx) + defer cancelTrading() environ := bbgo.NewEnvironment()