From ae5cd44b74719b3f29b98e7372c078a1e2c31ca2 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Fri, 23 Jul 2021 09:39:14 -0400 Subject: [PATCH] Remove unused timeout10() --- services/gunDB/contact-api/utils/index.js | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/services/gunDB/contact-api/utils/index.js b/services/gunDB/contact-api/utils/index.js index 0a802879..619b04d2 100644 --- a/services/gunDB/contact-api/utils/index.js +++ b/services/gunDB/contact-api/utils/index.js @@ -24,29 +24,6 @@ const delay = ms => new Promise(res => setTimeout(res, ms)) */ const mySecret = () => Promise.resolve(require('../../Mediator').getMySecret()) -/** - * @template T - * @param {Promise} promise - * @returns {Promise} - */ -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} promise