From 53ca70462019bd1a131036bdaf6c2e930cabe2d3 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 21 Aug 2024 22:55:39 -0300 Subject: [PATCH] Update index.ts --- apps/api/src/index.ts | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index df9dcf0b..2b68e0f1 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -189,31 +189,6 @@ if (cluster.isMaster) { -async function sendScrapeRequests() { - await new Promise(resolve => setTimeout(resolve, 5000)); - const url = 'http://127.0.0.1:3002/v0/scrape'; - const headers = { - 'Authorization': 'Bearer fc-365b09a44b8844d08e0dc98f13e49bca', - 'Content-Type': 'application/json' - }; - const body = JSON.stringify({ - url: 'https://roastmywebsite.ai' - }); - - const requests = Array.from({ length: 20 }, (_, i) => - fetch(url, { - method: 'POST', - headers: headers, - body: body - }).catch(error => { - Logger.error(`Request ${i + 1} encountered an error: ${error.message}`); - }) - ); - - await Promise.all(requests); -} - -// sendScrapeRequests(); // const sq = getScrapeQueue(); // sq.on("waiting", j => ScrapeEvents.logJobEvent(j, "waiting"));