File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { useHandler } from '../../hooks/useHandler'
1515import { formatDate } from '../../locales/intl'
1616import { lstrings } from '../../locales/strings'
1717import { fixSides , mapSides , sidesToMargin } from '../../util/sides'
18+ import { snooze } from '../../util/utils'
1819import { MinimalButton } from '../buttons/MinimalButton'
1920import { FillLoader } from '../progress-indicators/FillLoader'
2021import { Theme , useTheme } from '../services/ThemeContext'
@@ -219,8 +220,11 @@ const SwipeChartComponent = (params: Props) => {
219220 // Rate limit error, use our API key as a fallback
220221 if ( ! fetchUrl . includes ( 'x_cg_pro_api_key' ) && ENV . COINGECKO_API_KEY !== '' ) {
221222 fetchUrl = `${ COINGECKO_URL_PRO } ${ fetchPath } &x_cg_pro_api_key=${ ENV . COINGECKO_API_KEY } `
222- continue
223223 }
224+ // Wait 2 second before retrying. It typically takes 1 minute
225+ // before rate limiting is relieved, so even 2 seconds is hasty.
226+ await snooze ( 2000 )
227+ continue
224228 }
225229 throw new Error ( `Failed to fetch market data: ${ apiError . status . error_code } ${ apiError . status . error_message } ` )
226230 }
You can’t perform that action at this time.
0 commit comments