From cdcce5a939c88cc256df17aedae8d16b5c44b697 Mon Sep 17 00:00:00 2001 From: Viet Huynh Date: Thu, 2 Nov 2023 02:58:24 +0700 Subject: [PATCH] remove sleep function --- lib/api.js | 3 --- lib/utils.js | 7 ------- 2 files changed, 10 deletions(-) diff --git a/lib/api.js b/lib/api.js index a647fa0..ef4c138 100644 --- a/lib/api.js +++ b/lib/api.js @@ -1,6 +1,5 @@ import { LIST_ITEM_SIZE } from "./constants.js"; import { requestGateway } from "./helpers.js"; -import { sleep } from "./utils.js"; /** * Gets Zero Trust lists. @@ -47,7 +46,6 @@ export const createZeroTrustListsOneByOne = async (items) => { try { await createZeroTrustList(listName, chunk); - await sleep(); totalListNumber--; listNumber++; console.log(`Created "${listName}" list - ${totalListNumber} left`); @@ -104,7 +102,6 @@ export const deleteZeroTrustListsOneByOne = async (lists) => { for (const { id, name } of lists) { try { await deleteZeroTrustList(id); - await sleep(); totalListNumber--; console.log(`Deleted ${name} list - ${totalListNumber} left`); } catch (err) { diff --git a/lib/utils.js b/lib/utils.js index 607be0f..79ad4ea 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -7,13 +7,6 @@ if (!globalThis.fetch) { globalThis.fetch = (await import("node-fetch")).default; } -/** - * Sleeps for a specified amount of time. - * @param {number} [ms=350] The amount of time in ms. - */ -export const sleep = (ms = 350) => - new Promise((resolve) => setTimeout(resolve, ms)); - /** * Checks if the value is a valid domain. * @param {string} value The value to be checked.