mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
add defer close
This commit is contained in:
parent
479de002a6
commit
e947a05cbd
|
@ -322,6 +322,9 @@ var BacktestCmd = &cobra.Command{
|
||||||
})
|
})
|
||||||
|
|
||||||
dumper := backtest.NewKLineDumper(kLineDataDir)
|
dumper := backtest.NewKLineDumper(kLineDataDir)
|
||||||
|
defer func() {
|
||||||
|
_ = dumper.Close()
|
||||||
|
}()
|
||||||
defer func() {
|
defer func() {
|
||||||
if err := dumper.Close(); err != nil {
|
if err := dumper.Close(); err != nil {
|
||||||
log.WithError(err).Errorf("kline dumper can not close files")
|
log.WithError(err).Errorf("kline dumper can not close files")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user