Merge pull request #495 from linkwarden/dev

more efficient logic for the background script
This commit is contained in:
Daniel 2024-03-06 02:58:42 +03:30 committed by GitHub
commit 7dd254af48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 49 deletions

View File

@ -85,11 +85,11 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
image: image:
user.archiveAsScreenshot && !link.image?.startsWith("archive") user.archiveAsScreenshot && !link.image?.startsWith("archive")
? "pending" ? "pending"
: undefined, : "unavailable",
pdf: pdf:
user.archiveAsPDF && !link.pdf?.startsWith("archive") user.archiveAsPDF && !link.pdf?.startsWith("archive")
? "pending" ? "pending"
: undefined, : "unavailable",
readable: !link.readable?.startsWith("archive") readable: !link.readable?.startsWith("archive")
? "pending" ? "pending"
: undefined, : undefined,

View File

@ -19,36 +19,16 @@ async function processBatch() {
url: { not: null }, url: { not: null },
OR: [ OR: [
{ {
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: null, image: null,
}, },
{ {
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: "pending", image: "pending",
}, },
/////////////////////// ///////////////////////
{ {
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: null, pdf: null,
}, },
{ {
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: "pending", pdf: "pending",
}, },
/////////////////////// ///////////////////////
@ -76,36 +56,16 @@ async function processBatch() {
url: { not: null }, url: { not: null },
OR: [ OR: [
{ {
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: null, image: null,
}, },
{ {
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: "pending", image: "pending",
}, },
/////////////////////// ///////////////////////
{ {
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: null, pdf: null,
}, },
{ {
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: "pending", pdf: "pending",
}, },
/////////////////////// ///////////////////////
@ -115,13 +75,6 @@ async function processBatch() {
{ {
readable: "pending", readable: "pending",
}, },
///////////////////////
{
preview: null,
},
{
preview: "pending",
},
], ],
}, },
take: archiveTakeCount, take: archiveTakeCount,