minor changes
This commit is contained in:
parent
099024518f
commit
650fa693bd
|
@ -236,7 +236,7 @@ export default function LinkCard({ link, count, className }: Props) {
|
|||
<div className="flex items-baseline gap-1">
|
||||
<p className="text-sm text-neutral">{count + 1}</p>
|
||||
<p className="text-lg truncate w-full pr-8">
|
||||
{unescapeString(link.name || link.description) || shortendURL}
|
||||
{unescapeString(link.name || link.description) || link.url}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ŝarĝante…
Reference in New Issue