Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

log processing queue to console

daniel31x13195cb99c90ee
diff --git a/apps/worker/worker.ts b/apps/worker/worker.ts
index 4f1cfffc..0ec3af7c 100644
--- a/apps/worker/worker.ts
+++ b/apps/worker/worker.ts
@@ -76,6 +76,11 @@ async function startArchiveProcessing() {
},
});
+ if (links.length === 0) {
+ await delay(archiveIntervalInSeconds);
+ continue;
+ }
+
const archiveLink = async (link: LinkWithCollectionOwnerAndTags) => {
try {
console.log(
@@ -102,6 +107,21 @@ async function startArchiveProcessing() {
const processingPromises = links.map((e) => archiveLink(e));
await Promise.allSettled(processingPromises);
+
+ const unprocessedLinkCount = await prisma.link.count({
+ where: {
+ lastPreserved: null,
+ url: { not: null },
+ },
+ });
+
+ console.log(
+ "\x1b[34m%s\x1b[0m",
+ `Processed ${links.length} link${
+ links.length === 1 ? "" : "s"
+ }, ${unprocessedLinkCount} left.`
+ );
+
await delay(archiveIntervalInSeconds);
}
}