You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I'm currently working on implementation of exponential backoff technique in ofetch retryDelay and currently I have this
retryDelay: (ctx)=>{constinitialDelay=1000;constexponentialBase=2;constattempt=getAttempt(ctx.options.headers.get(HEADER_RETRY_ATTEMPT));ctx.options.headers.set(HEADER_RETRY_ATTEMPT,`${attempt+1}`);constexponentialDelay=initialDelay*Math.pow(exponentialBase,attempt-1);constjitter=getRandomInt(200,500);constdelay=Math.min(exponentialDelay+jitter,20_000);console.debug(`Retrying request in ${delay}ms`);returndelay;},
The solution isn't exactly ideal since I'm using headers to store data, how can I track what number of attempt is currently being retried? I might be missing something here or I could solve it somehow with scopes, but I'm not sure, maybe it has to be implemented within the library and I should make a feature request/pull request?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! I'm currently working on implementation of exponential backoff technique in ofetch retryDelay and currently I have this
The solution isn't exactly ideal since I'm using headers to store data, how can I track what number of attempt is currently being retried? I might be missing something here or I could solve it somehow with scopes, but I'm not sure, maybe it has to be implemented within the library and I should make a feature request/pull request?
Beta Was this translation helpful? Give feedback.
All reactions