Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The table is not refreshing even with --refresh-rate specified. #104

Closed
zhqu1148980644 opened this issue Apr 7, 2021 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@zhqu1148980644
Copy link

The table didn't refresh at all, though there is a refreshing .. text blinking at the right corner.

@miguelmota miguelmota added the bug Something isn't working label Apr 25, 2021
@lyricnz
Copy link
Collaborator

lyricnz commented Sep 26, 2021

It's possible you were hitting coingecko rate limiting? Did you set the refresh-rate very high?

@lyricnz
Copy link
Collaborator

lyricnz commented Oct 22, 2021

@zhqu1148980644 can you reproduce this? WIth latest code (not yet in a release), there is an option to log HTTP traffic (set DEBUG_HTTP to 1). This may help to diagnose a problem with coingecko rejecting the request.

@reallyallnamestaken
Copy link

I have the same issue.
According to coingecko's site free API call limit is 50 calls per minute. How many calls do you make when building/refreshing the list?

@lyricnz
Copy link
Collaborator

lyricnz commented Oct 24, 2021

It's actually about 40 for the full refresh - and there's an open issue #228 to look into reducing the amount of calls/traffic. One thing that could be causing it for you - if you are behind cgnat (your internet provider is aggregating traffic) you may be hitting the limit even when you personally are not using 50/minute.

If you download the current code and build it, DEBUG_HTTP will show when coingecko is denying the request due to excess traffic. The logs will be written to /tmp/cointop.log and the lines you are interested in contain "doReq"

$ tail -F /tmp/cointop.log | grep doReq
time="2021-10-24T12:04:33+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=7&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:35+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=8&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:36+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=9&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:37+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/global"
time="2021-10-24T12:04:37+11:00" level=debug msg="doReq GET https://www.coingecko.com/market_cap/total_charts_data?duration=365&locale=en&vs_currency=usd"
time="2021-10-24T12:04:37+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/global"
time="2021-10-24T12:04:38+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=10&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:38+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/exchange_rates"
time="2021-10-24T12:04:40+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=11&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:41+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=12&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:43+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=13&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:45+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=14&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:45+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=1&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:47+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=2&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:48+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/coins/markets?order=market_cap_desc&page=3&per_page=250&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y&sparkline=false&vs_currency=gbp"
time="2021-10-24T12:04:48+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/global"
time="2021-10-24T12:04:48+11:00" level=debug msg="doReq GET https://api.coingecko.com/api/v3/global"

@lyricnz
Copy link
Collaborator

lyricnz commented Oct 24, 2021

If you're not interested in low-cap coins, you can reduce the number of coins that cointop fetches details for by passing (for example) --max-pages 5 . By default it's fetching:

// DefaultPerPage ...
var DefaultPerPage = uint(100)

// DefaultMaxPages ...
var DefaultMaxPages = uint(35)

@lyricnz
Copy link
Collaborator

lyricnz commented Oct 25, 2021

@reallyallnamestaken can you try this, and provide details about why your refresh is failing?

lyricnz added a commit to lyricnz/cointop that referenced this issue Oct 25, 2021
lyricnz added a commit that referenced this issue Oct 28, 2021
…ackend... (#255)

* Reduce the number of pages to 10 (1000 coins) to reduce the load on backend, and increase refresh time. See #104 #228

* Add note about --max-pages and --per-page
@lyricnz
Copy link
Collaborator

lyricnz commented Nov 7, 2021

Any updates @zhqu1148980644 ?

@zhqu1148980644
Copy link
Author

zhqu1148980644 commented Nov 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants