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 @@ -14,6 +14,7 @@ import { formatFiatString } from '../../hooks/useFiatText'
1414import { useHandler } from '../../hooks/useHandler'
1515import { formatDate } from '../../locales/intl'
1616import { lstrings } from '../../locales/strings'
17+ import { snooze } from '../../util/utils'
1718import { MinimalButton } from '../buttons/MinimalButton'
1819import { FillLoader } from '../progress-indicators/FillLoader'
1920import { Theme , useTheme } from '../services/ThemeContext'
@@ -213,8 +214,11 @@ const SwipeChartComponent = (params: Props) => {
213214 // Rate limit error, use our API key as a fallback
214215 if ( ! fetchUrl . includes ( 'x_cg_pro_api_key' ) && ENV . COINGECKO_API_KEY !== '' ) {
215216 fetchUrl = `${ COINGECKO_URL_PRO } ${ fetchPath } &x_cg_pro_api_key=${ ENV . COINGECKO_API_KEY } `
216- continue
217217 }
218+ // Wait 2 second before retrying. It typically takes 1 minute
219+ // before rate limiting is relieved, so even 2 seconds is hasty.
220+ await snooze ( 2000 )
221+ continue
218222 }
219223 throw new Error ( `Failed to fetch market data: ${ apiError . status . error_code } ${ apiError . status . error_message } ` )
220224 }
You can’t perform that action at this time.
0 commit comments