mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1133 from c9s/fix/batch-query/end-if-start-greater-than-end
FIX: end batch query if start > end
This commit is contained in:
commit
6d8b3d7f5b
|
@ -72,17 +72,12 @@ func (q *AsyncTimeRangedBatchQuery) Query(ctx context.Context, ch interface{}, s
|
|||
|
||||
if listLen == 0 {
|
||||
if q.JumpIfEmpty > 0 {
|
||||
startTime2 := startTime.Add(q.JumpIfEmpty)
|
||||
if startTime2.After(endTime) {
|
||||
startTime = endTime
|
||||
endTime = startTime2
|
||||
} else {
|
||||
startTime = startTime.Add(q.JumpIfEmpty)
|
||||
}
|
||||
|
||||
if startTime.Before(endTime) {
|
||||
log.Debugf("batch querying %T: empty records jump to %s", q.Type, startTime)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
log.Debugf("batch querying %T: empty records, query is completed", q.Type)
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user