chore(jslib): add timeout log to api calls
Might potentially help with spurious AbortError issues
This commit is contained in:
parent
d55c758ad3
commit
632da40cbb
2 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@upnd/upend",
|
||||
"version": "0.5.4",
|
||||
"version": "0.5.5",
|
||||
"description": "Client library to interact with the UpEnd system.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
@ -481,7 +481,10 @@ export class UpEndApi {
|
|||
const controller = options?.abortController || new AbortController();
|
||||
const timeout = options?.timeout || this.timeout;
|
||||
if (timeout > 0) {
|
||||
setTimeout(() => controller.abort(), timeout);
|
||||
setTimeout(() => {
|
||||
dbg("Aborting request after %d ms", timeout);
|
||||
controller.abort();
|
||||
}, timeout);
|
||||
}
|
||||
return controller.signal;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue