From fc1cadc808836695b756c77a827d29c8b47f9acd Mon Sep 17 00:00:00 2001 From: Haiss2 Date: Fri, 12 Jul 2024 17:47:17 +0700 Subject: [PATCH] Ignore Invalid symbol error --- pkg/pricefiller/price_fillter.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/pricefiller/price_fillter.go b/pkg/pricefiller/price_fillter.go index ed28e41..71e5ca8 100644 --- a/pkg/pricefiller/price_fillter.go +++ b/pkg/pricefiller/price_fillter.go @@ -21,6 +21,7 @@ const ( backfillTradeLogsLimit = 60 addressETH = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" coinUSDT = "USDT" + invalidSymbolErrString = " code=-1121, msg=Invalid symbol." ) var ( @@ -158,8 +159,10 @@ func (p *PriceFiller) fullFillTradeLog(tradeLog storage.TradeLog) (storage.Trade makerPrice, makerUsdAmount, err := p.getPriceAndAmountUsd(strings.ToLower(tradeLog.MakerToken), tradeLog.MakerTokenAmount, int64(tradeLog.Timestamp)) if err != nil { - p.l.Errorw("Failed to getPriceAndAmountUsd for maker", "err", err) - return tradeLog, err + if err.Error() != invalidSymbolErrString { + p.l.Errorw("Failed to getPriceAndAmountUsd for maker", "err", err) + return tradeLog, err + } } tradeLog.MakerTokenPrice = makerPrice @@ -168,8 +171,10 @@ func (p *PriceFiller) fullFillTradeLog(tradeLog storage.TradeLog) (storage.Trade takerPrice, takerUsdAmount, err := p.getPriceAndAmountUsd(strings.ToLower(tradeLog.TakerToken), tradeLog.TakerTokenAmount, int64(tradeLog.Timestamp)) if err != nil { - p.l.Errorw("Failed to getPriceAndAmountUsd for taker", "err", err) - return tradeLog, err + if err.Error() != invalidSymbolErrString { + p.l.Errorw("Failed to getPriceAndAmountUsd for taker", "err", err) + return tradeLog, err + } } tradeLog.TakerTokenPrice = takerPrice