mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
batch: fix JumpIfEmpty algorithm
This commit is contained in:
parent
5bbe4ecd57
commit
2fed98ea55
|
@ -72,7 +72,13 @@ func (q *AsyncTimeRangedBatchQuery) Query(ctx context.Context, ch interface{}, s
|
|||
|
||||
if listLen == 0 {
|
||||
if q.JumpIfEmpty > 0 {
|
||||
startTime = startTime.Add(q.JumpIfEmpty)
|
||||
startTime2 := startTime.Add(q.JumpIfEmpty)
|
||||
if startTime2.After(endTime) {
|
||||
startTime = endTime
|
||||
endTime = startTime2
|
||||
} else {
|
||||
startTime = startTime.Add(q.JumpIfEmpty)
|
||||
}
|
||||
|
||||
log.Debugf("batch querying %T: empty records jump to %s", q.Type, startTime)
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue
Block a user