Remove unused timeout10()

This commit is contained in:
Daniel Lugo 2021-07-23 09:39:14 -04:00
parent 6d3f9e9f01
commit ae5cd44b74

View file

@ -24,29 +24,6 @@ const delay = ms => new Promise(res => setTimeout(res, ms))
*/
const mySecret = () => Promise.resolve(require('../../Mediator').getMySecret())
/**
* @template T
* @param {Promise<T>} promise
* @returns {Promise<T>}
*/
const timeout10 = promise => {
/** @type {NodeJS.Timeout} */
// @ts-ignore
let timeoutID
return Promise.race([
promise.then(v => {
clearTimeout(timeoutID)
return v
}),
new Promise((_, rej) => {
timeoutID = setTimeout(() => {
rej(new Error(Constants.ErrorCode.TIMEOUT_ERR))
}, 10000)
})
])
}
/**
* @template T
* @param {Promise<T>} promise