add defer close

This commit is contained in:
c9s 2022-05-11 14:37:45 +08:00
parent 479de002a6
commit e947a05cbd
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -322,6 +322,9 @@ var BacktestCmd = &cobra.Command{
})
dumper := backtest.NewKLineDumper(kLineDataDir)
defer func() {
_ = dumper.Close()
}()
defer func() {
if err := dumper.Close(); err != nil {
log.WithError(err).Errorf("kline dumper can not close files")