mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-14 13:55:57 +08:00
fix: potential fix for firestore grpc connection reset
This commit is contained in:
parent
fd328cbcc2
commit
4830ff5fda
@ -1,7 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM lwthiker/curl-impersonate:0.6-chrome-slim-bullseye
|
||||
|
||||
FROM node:20
|
||||
FROM node:22
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y wget gnupg \
|
||||
|
@ -519,7 +519,19 @@ export class CrawlerHost extends RPCHost {
|
||||
async queryCache(urlToCrawl: URL, cacheTolerance: number) {
|
||||
const digest = this.getUrlDigest(urlToCrawl);
|
||||
|
||||
const cache = (await Crawled.fromFirestoreQuery(Crawled.COLLECTION.where('urlPathDigest', '==', digest).orderBy('createdAt', 'desc').limit(1)))?.[0];
|
||||
const cache = (
|
||||
await
|
||||
(Crawled.fromFirestoreQuery(
|
||||
Crawled.COLLECTION.where('urlPathDigest', '==', digest).orderBy('createdAt', 'desc').limit(1)
|
||||
).catch((err) => {
|
||||
this.logger.warn(`Failed to query cache, unknown issue`, { err });
|
||||
// https://github.com/grpc/grpc-node/issues/2647
|
||||
// https://github.com/googleapis/nodejs-firestore/issues/1023
|
||||
// https://github.com/googleapis/nodejs-firestore/issues/1023
|
||||
|
||||
return undefined;
|
||||
}))
|
||||
)?.[0];
|
||||
|
||||
if (!cache) {
|
||||
return undefined;
|
||||
|
Loading…
x
Reference in New Issue
Block a user