Adi
Adi3y ago

Adi – 18-39 Feb 8

I am trying to make API call after some delay with 3-5 secs but it fails everytime any idea why it is happening? Any suggestions for improvement?
async function foo(account_id, id, oauth_access_token) {
return new Promise((resolve, reject) => {
setTimeout(async () => {
const result = await axios.post(`API`)
resolve(result);
}, 5000);
});
}
async function foo(account_id, id, oauth_access_token) {
return new Promise((resolve, reject) => {
setTimeout(async () => {
const result = await axios.post(`API`)
resolve(result);
}, 5000);
});
}
2 Replies
ScriptyChris
ScriptyChris3y ago
what do you mean by "it fails every time"? What exactly happens?
reactibot
reactibot3y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/940678218120306788