Move more logic into sync-client
This commit is contained in:
parent
3f089bd37e
commit
9177984ff6
1 changed files with 68 additions and 143 deletions
|
|
@ -1,14 +0,0 @@
|
|||
export const slowFetchFactory =
|
||||
(jitterScaleInSeconds: number) =>
|
||||
async (
|
||||
input: string | URL | globalThis.Request,
|
||||
init?: RequestInit
|
||||
): Promise<Response> => {
|
||||
if (jitterScaleInSeconds > 0) {
|
||||
await sleep(Math.random() * jitterScaleInSeconds * 1000);
|
||||
}
|
||||
|
||||
const response = await fetch(input, init);
|
||||
|
||||
return response;
|
||||
};
|
||||
Loading…
Reference in a new issue