From 6e562e2ededf1d653da82ffaf148eae1e093031f Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 19 Jun 2022 17:41:52 +0800 Subject: [PATCH] increase batch insert size to 1000 for klines Signed-off-by: c9s --- config/support.yaml | 5 +++-- pkg/service/backtest.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/support.yaml b/config/support.yaml index 94a2a7d12..c281be30b 100644 --- a/config/support.yaml +++ b/config/support.yaml @@ -29,9 +29,10 @@ riskControls: backtest: startTime: "2020-09-04" endTime: "2020-09-14" + sessions: + - binance symbols: - - BTCUSDT - - ETHUSDT + - LINKUSDT account: binance: balances: diff --git a/pkg/service/backtest.go b/pkg/service/backtest.go index 8c1edfac0..256514fcf 100644 --- a/pkg/service/backtest.go +++ b/pkg/service/backtest.go @@ -52,7 +52,7 @@ func (s *BacktestService) SyncKLineByInterval(ctx context.Context, exchange type q := &batch.KLineBatchQuery{Exchange: exchange} return q.Query(ctx, symbol, interval, startTime, endTime) }, - BatchInsertBuffer: 500, + BatchInsertBuffer: 1000, BatchInsert: func(obj interface{}) error { kLines := obj.([]types.KLine) return s.BatchInsert(kLines)