mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader.git
synced 2025-08-19 02:25:53 +08:00
fix: serper search caching
This commit is contained in:
parent
7c029bf429
commit
ef2f87cd7d
@ -478,14 +478,14 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n')}\n` : ''}`;
|
|||||||
const r = await this.serperSearchService.webSearch(query);
|
const r = await this.serperSearchService.webSearch(query);
|
||||||
|
|
||||||
const nowDate = new Date();
|
const nowDate = new Date();
|
||||||
const record = SearchResult.from({
|
const record = SerperSearchResult.from({
|
||||||
query,
|
query,
|
||||||
queryDigest,
|
queryDigest,
|
||||||
response: r,
|
response: r,
|
||||||
createdAt: nowDate,
|
createdAt: nowDate,
|
||||||
expireAt: new Date(nowDate.valueOf() + this.cacheRetentionMs)
|
expireAt: new Date(nowDate.valueOf() + this.cacheRetentionMs)
|
||||||
});
|
});
|
||||||
SearchResult.save(record.degradeForFireStore()).catch((err) => {
|
SerperSearchResult.save(record.degradeForFireStore()).catch((err) => {
|
||||||
this.logger.warn(`Failed to cache search result`, { err });
|
this.logger.warn(`Failed to cache search result`, { err });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user