fix: blockade query

This commit is contained in:
Yanlong Wang 2024-06-01 08:06:46 +08:00
parent d2bebec60f
commit 7a7e49bc00
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -635,7 +635,10 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
}); });
} }
const blockade = (await DomainBlockade.fromFirestoreQuery( const blockade = (await DomainBlockade.fromFirestoreQuery(
DomainBlockade.COLLECTION.where('domain', '==', urlToCrawl.hostname.toLowerCase()).limit(1) DomainBlockade.COLLECTION
.where('domain', '==', urlToCrawl.hostname.toLowerCase())
.where('expireAt', '>=', new Date())
.limit(1)
))[0]; ))[0];
if (blockade) { if (blockade) {