Open unliar opened 3 years ago
const retry = async (promise, times = 0) => { try { return await promise(); } catch (error) { times= times -1; if (times>=0) { return await retry(promise, times); } else { throw error; } }