From c257bc8ccfdbce85a0653073fe63afa0dbd9b594 Mon Sep 17 00:00:00 2001 From: chiahung Date: Tue, 17 Oct 2023 13:51:51 +0800 Subject: [PATCH] sleep 100ms to avoid DDOS --- pkg/strategy/grid2/active_order_recover.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/strategy/grid2/active_order_recover.go b/pkg/strategy/grid2/active_order_recover.go index 60774d229..9ad16a78c 100644 --- a/pkg/strategy/grid2/active_order_recover.go +++ b/pkg/strategy/grid2/active_order_recover.go @@ -110,6 +110,9 @@ func syncActiveOrders(ctx context.Context, opts SyncActiveOrdersOpts) error { } else { 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 { opts.logger.WithError(err).Errorf("[ActiveOrderRecover] unable to query order #%d", activeOrder.OrderID) errs = multierr.Append(errs, err)