mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 13:38:37 +00:00
remove sleep function
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user