From b7b66cfd9aad22f3a00e3b3126a708d1d81e0447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 26 Nov 2019 13:15:55 +0100 Subject: [PATCH] EventIndex: Use the sleep method from our utils. --- src/indexing/EventIndex.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/indexing/EventIndex.js b/src/indexing/EventIndex.js index ae738e5d4d..f034df888c 100644 --- a/src/indexing/EventIndex.js +++ b/src/indexing/EventIndex.js @@ -16,6 +16,7 @@ limitations under the License. import PlatformPeg from "../PlatformPeg"; import {MatrixClientPeg} from "../MatrixClientPeg"; +import {sleep} from "../utils/promise"; /* * Event indexing class that wraps the platform specific event indexing. @@ -180,12 +181,6 @@ export default class EventIndex { } async crawlerFunc() { - // TODO either put this in a better place or find a library provided - // method that does this. - const sleep = async (ms) => { - return new Promise(resolve => setTimeout(resolve, ms)); - }; - let cancelled = false; console.log("EventIndex: Started crawler function");