From 650fa693bd4aae665dce3d1ccd7ae6715e1fb9d0 Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Tue, 12 Dec 2023 13:26:53 -0500 Subject: [PATCH] minor changes --- components/LinkCard.tsx | 2 +- scripts/lib/urlHandler.ts | 3 --- scripts/worker.ts | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/components/LinkCard.tsx b/components/LinkCard.tsx index f12fcb5..62a6cfb 100644 --- a/components/LinkCard.tsx +++ b/components/LinkCard.tsx @@ -236,7 +236,7 @@ export default function LinkCard({ link, count, className }: Props) {

{count + 1}

- {unescapeString(link.name || link.description) || shortendURL} + {unescapeString(link.name || link.description) || link.url}

diff --git a/scripts/lib/urlHandler.ts b/scripts/lib/urlHandler.ts index 6843805..c9bdd85 100644 --- a/scripts/lib/urlHandler.ts +++ b/scripts/lib/urlHandler.ts @@ -43,11 +43,9 @@ export default async function urlHandler(link: LinksAndCollectionAndOwner) { // TODO // const session = await page.context().newCDPSession(page); - // const doc = await session.send("Page.captureSnapshot", { // format: "mhtml", // }); - // const saveDocLocally = (doc: any) => { // console.log(doc); // return createFile({ @@ -55,7 +53,6 @@ export default async function urlHandler(link: LinksAndCollectionAndOwner) { // filePath: `archives/${targetLink.collectionId}/${link.id}.mhtml`, // }); // }; - // saveDocLocally(doc.data); // Readability diff --git a/scripts/worker.ts b/scripts/worker.ts index 025be51..cba684c 100644 --- a/scripts/worker.ts +++ b/scripts/worker.ts @@ -99,7 +99,7 @@ async function processBatch() { await Promise.allSettled(processingPromises); } -const intervalInMinutes = Number(process.env.ARCHIVE_SCRIPT_INTERVAL) || 10; +const intervalInSeconds = Number(process.env.ARCHIVE_SCRIPT_INTERVAL) || 10; function delay(sec: number) { return new Promise((resolve) => setTimeout(resolve, sec * 1000)); @@ -110,10 +110,10 @@ async function init() { while (true) { try { await processBatch(); - await delay(intervalInMinutes); + await delay(intervalInSeconds); } catch (error) { console.error("\x1b[34m%s\x1b[0m", "Error processing links:", error); - await delay(intervalInMinutes); + await delay(intervalInSeconds); } } }