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,16 +72,11 @@ func (q *AsyncTimeRangedBatchQuery) Query(ctx context.Context, ch interface{}, s
|
||||||
|
|
||||||
if listLen == 0 {
|
if listLen == 0 {
|
||||||
if q.JumpIfEmpty > 0 {
|
if q.JumpIfEmpty > 0 {
|
||||||
startTime2 := startTime.Add(q.JumpIfEmpty)
|
startTime = startTime.Add(q.JumpIfEmpty)
|
||||||
if startTime2.After(endTime) {
|
if startTime.Before(endTime) {
|
||||||
startTime = endTime
|
log.Debugf("batch querying %T: empty records jump to %s", q.Type, startTime)
|
||||||
endTime = startTime2
|
continue
|
||||||
} else {
|
|
||||||
startTime = startTime.Add(q.JumpIfEmpty)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
log.Debugf("batch querying %T: empty records, query is completed", q.Type)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user