mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Update index.ts
This commit is contained in:
parent
477c3257dc
commit
53ca704620
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue
Block a user