mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
fix: move clearTimeout to finally()
This commit is contained in:
parent
c02742e041
commit
a9c1ffabfe
10 changed files with 10 additions and 20 deletions
|
@ -89,8 +89,7 @@ export async function fn (data, opts) {
|
|||
})()
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -70,8 +70,7 @@ export async function fn (data, opts) {
|
|||
})
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -56,8 +56,7 @@ export async function fn (data, opts) {
|
|||
})
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -68,8 +68,7 @@ export async function fn (data, opts) {
|
|||
})
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -83,8 +83,7 @@ export async function fn (data, opts) {
|
|||
}
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -80,8 +80,7 @@ export async function fn (data, opts) {
|
|||
}
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -72,8 +72,7 @@ export async function fn (data, opts) {
|
|||
})
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -104,8 +104,7 @@ export async function fn (data, opts) {
|
|||
}
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -99,8 +99,7 @@ export async function fn (data, opts) {
|
|||
})
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
|
@ -176,8 +176,7 @@ export async function fn (data, opts) {
|
|||
})()
|
||||
})
|
||||
|
||||
return Promise.race([fetchPromise, timeoutPromise]).then((result) => {
|
||||
return Promise.race([fetchPromise, timeoutPromise]).finally(() => {
|
||||
clearTimeout(timeoutHandle)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue