minor changes

This commit is contained in:
daniel31x13 2023-12-12 13:26:53 -05:00
parent 099024518f
commit 650fa693bd
3 changed files with 4 additions and 7 deletions

View File

@ -236,7 +236,7 @@ export default function LinkCard({ link, count, className }: Props) {
<div className="flex items-baseline gap-1"> <div className="flex items-baseline gap-1">
<p className="text-sm text-neutral">{count + 1}</p> <p className="text-sm text-neutral">{count + 1}</p>
<p className="text-lg truncate w-full pr-8"> <p className="text-lg truncate w-full pr-8">
{unescapeString(link.name || link.description) || shortendURL} {unescapeString(link.name || link.description) || link.url}
</p> </p>
</div> </div>

View File

@ -43,11 +43,9 @@ export default async function urlHandler(link: LinksAndCollectionAndOwner) {
// TODO // TODO
// const session = await page.context().newCDPSession(page); // const session = await page.context().newCDPSession(page);
// const doc = await session.send("Page.captureSnapshot", { // const doc = await session.send("Page.captureSnapshot", {
// format: "mhtml", // format: "mhtml",
// }); // });
// const saveDocLocally = (doc: any) => { // const saveDocLocally = (doc: any) => {
// console.log(doc); // console.log(doc);
// return createFile({ // return createFile({
@ -55,7 +53,6 @@ export default async function urlHandler(link: LinksAndCollectionAndOwner) {
// filePath: `archives/${targetLink.collectionId}/${link.id}.mhtml`, // filePath: `archives/${targetLink.collectionId}/${link.id}.mhtml`,
// }); // });
// }; // };
// saveDocLocally(doc.data); // saveDocLocally(doc.data);
// Readability // Readability

View File

@ -99,7 +99,7 @@ async function processBatch() {
await Promise.allSettled(processingPromises); 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) { function delay(sec: number) {
return new Promise((resolve) => setTimeout(resolve, sec * 1000)); return new Promise((resolve) => setTimeout(resolve, sec * 1000));
@ -110,10 +110,10 @@ async function init() {
while (true) { while (true) {
try { try {
await processBatch(); await processBatch();
await delay(intervalInMinutes); await delay(intervalInSeconds);
} catch (error) { } catch (error) {
console.error("\x1b[34m%s\x1b[0m", "Error processing links:", error); console.error("\x1b[34m%s\x1b[0m", "Error processing links:", error);
await delay(intervalInMinutes); await delay(intervalInSeconds);
} }
} }
} }