Skip to content

Commit

Permalink
disable failing code
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermayone committed Jan 12, 2025
1 parent 0e76c25 commit 25377d1
Showing 1 changed file with 47 additions and 47 deletions.
94 changes: 47 additions & 47 deletions src/functions/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,53 +50,53 @@ export async function domainCheck(domain: string) {
});
}

let browser;

if (process.env.NODE_ENV === "development") {
browser = await chromium.launch();
} else {
browser = await chromium.launch({
executablePath: "/usr/bin/chromium-browser",
args: [
"--disable-dev-shm-usage",
"--disable-setuid-sandbox",
"--no-sandbox",
],
chromiumSandbox: false,
});
}

const context = await browser.newContext();
const page = await context.newPage();

// Navigate to the domain
await page.goto(`https://${domain}`, {
// waitUntil: "networkidle",
});

const pageimgBuffer = await page.screenshot({
type: "png",
});

console.log("\n");
console.log(pageimgBuffer);
console.log("\n");

// Save to database
await prisma.capture.create({
data: {
domain: {
connect: {
id: dbDomain.id,
},
},
binary: pageimgBuffer,
},
});

// Clean up
await context.close();
await browser.close();
// let browser;

// if (process.env.NODE_ENV === "development") {
// browser = await chromium.launch();
// } else {
// browser = await chromium.launch({
// executablePath: "/usr/bin/chromium-browser",
// args: [
// "--disable-dev-shm-usage",
// "--disable-setuid-sandbox",
// "--no-sandbox",
// ],
// chromiumSandbox: false,
// });
// }

// const context = await browser.newContext();
// const page = await context.newPage();

// // Navigate to the domain
// await page.goto(`https://${domain}`, {
// // waitUntil: "networkidle",
// });

// const pageimgBuffer = await page.screenshot({
// type: "png",
// });

// console.log("\n");
// console.log(pageimgBuffer);
// console.log("\n");

// // Save to database
// await prisma.capture.create({
// data: {
// domain: {
// connect: {
// id: dbDomain.id,
// },
// },
// binary: pageimgBuffer,
// },
// });

// // Clean up
// await context.close();
// await browser.close();

// metrics.timing("functions.timing.domainCheck", Date.now() - tsStart);

Expand Down

0 comments on commit 25377d1

Please # to comment.