mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
sleep 100ms to avoid DDOS
This commit is contained in:
parent
5ff3828ec1
commit
c257bc8ccf
|
@ -110,6 +110,9 @@ func syncActiveOrders(ctx context.Context, opts SyncActiveOrdersOpts) error {
|
||||||
} else {
|
} else {
|
||||||
opts.logger.Infof("found active order #%d is not in the open orders, updating...", activeOrder.OrderID)
|
opts.logger.Infof("found active order #%d is not in the open orders, updating...", activeOrder.OrderID)
|
||||||
|
|
||||||
|
// sleep 100ms to avoid DDOS
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
|
||||||
if err := syncActiveOrder(ctx, opts.activeOrderBook, opts.orderQueryService, activeOrder.OrderID); err != nil {
|
if err := syncActiveOrder(ctx, opts.activeOrderBook, opts.orderQueryService, activeOrder.OrderID); err != nil {
|
||||||
opts.logger.WithError(err).Errorf("[ActiveOrderRecover] unable to query order #%d", activeOrder.OrderID)
|
opts.logger.WithError(err).Errorf("[ActiveOrderRecover] unable to query order #%d", activeOrder.OrderID)
|
||||||
errs = multierr.Append(errs, err)
|
errs = multierr.Append(errs, err)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user