From 7b6dd0899ee0dd6f2fc54b1345e0a599ae12e472 Mon Sep 17 00:00:00 2001 From: Mikelle Date: Wed, 24 Mar 2021 22:36:07 +0300 Subject: [PATCH 1/2] added checker and log.warn to updateMethodTypeStatic --- priceupdater/priceupdater.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/priceupdater/priceupdater.go b/priceupdater/priceupdater.go index 7c56bf3..3d8814b 100644 --- a/priceupdater/priceupdater.go +++ b/priceupdater/priceupdater.go @@ -173,6 +173,9 @@ func (p *PriceUpdater) UpdatePrices(ctx context.Context) { tokenPrice, err = p.getTokenPriceCoingecko(ctx, token.Addr) case UpdateMethodTypeStatic: tokenPrice = token.StaticValue + if tokenPrice == float64(0) { + log.Warn("token price is set to 0. Probably StaticValue is not put in the configuration file") + } case UpdateMethodTypeIgnore: continue } From 561f491d5337033a641b13e369be2ad5869dec9c Mon Sep 17 00:00:00 2001 From: Mikelle Date: Thu, 25 Mar 2021 21:42:50 +0300 Subject: [PATCH 2/2] added token symbol to UpdateMethodTypeStatic log --- priceupdater/priceupdater.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/priceupdater/priceupdater.go b/priceupdater/priceupdater.go index 3d8814b..1658633 100644 --- a/priceupdater/priceupdater.go +++ b/priceupdater/priceupdater.go @@ -174,7 +174,8 @@ func (p *PriceUpdater) UpdatePrices(ctx context.Context) { case UpdateMethodTypeStatic: tokenPrice = token.StaticValue if tokenPrice == float64(0) { - log.Warn("token price is set to 0. Probably StaticValue is not put in the configuration file") + log.Warn("token price is set to 0. Probably StaticValue is not put in the configuration file,", + "token", token.Symbol) } case UpdateMethodTypeIgnore: continue