batch: set jump if empty field

This commit is contained in:
c9s 2022-06-01 15:54:27 +08:00
parent 484fc62892
commit 5bb98734fb
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
3 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@ func (e *MarginInterestBatchQuery) Query(ctx context.Context, asset string, star
query := &AsyncTimeRangedBatchQuery{
Type: types.MarginInterest{},
Limiter: rate.NewLimiter(rate.Every(5*time.Second), 2),
JumpIfEmpty: time.Hour * 24 * 30,
Q: func(startTime, endTime time.Time) (interface{}, error) {
return e.QueryInterestHistory(ctx, asset, &startTime, &endTime)
},

View File

@ -18,6 +18,7 @@ func (e *MarginLiquidationBatchQuery) Query(ctx context.Context, startTime, endT
query := &AsyncTimeRangedBatchQuery{
Type: types.MarginLiquidation{},
Limiter: rate.NewLimiter(rate.Every(5*time.Second), 2),
JumpIfEmpty: time.Hour * 24 * 30,
Q: func(startTime, endTime time.Time) (interface{}, error) {
return e.QueryLiquidationHistory(ctx, &startTime, &endTime)
},

View File

@ -18,6 +18,7 @@ func (e *MarginRepayBatchQuery) Query(ctx context.Context, asset string, startTi
query := &AsyncTimeRangedBatchQuery{
Type: types.MarginRepay{},
Limiter: rate.NewLimiter(rate.Every(5*time.Second), 2),
JumpIfEmpty: time.Hour * 24 * 30,
Q: func(startTime, endTime time.Time) (interface{}, error) {
return e.QueryRepayHistory(ctx, asset, &startTime, &endTime)
},