Corrected api code
This commit is contained in:
parent
13dcd1ff52
commit
08afa6452f
1 changed files with 2 additions and 1 deletions
|
|
@ -10,9 +10,10 @@ export async function fetchRate(pair) {
|
||||||
|
|
||||||
return queue.add(async () => {
|
return queue.add(async () => {
|
||||||
for (let attempt = 1; attempt <= 3; attempt++) {
|
for (let attempt = 1; attempt <= 3; attempt++) {
|
||||||
|
let timeout;
|
||||||
try {
|
try {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
const timeout = setTimeout(() => controller.abort(), 5000);
|
timeout = setTimeout(() => controller.abort(), 5000);
|
||||||
|
|
||||||
const res = await fetch(`https://api.uphold.com/v0/ticker/${key}`, {
|
const res = await fetch(`https://api.uphold.com/v0/ticker/${key}`, {
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue