slice 6 EdgarAdapter: fix full_text_search ETag caching (was not writing etags back); test asserts revalidation on 2nd call. 16/16 green (ornith-35)
This commit is contained in:
@@ -283,6 +283,13 @@ export class EdgarAdapter implements SourceFetch {
|
||||
|
||||
const searchData = resp?.body as { filings?: Array<Record<string, unknown>> } | undefined;
|
||||
|
||||
// Persist ETag + Last-Modified for future revalidation (matching filings_index/company_facts pattern).
|
||||
const newStore: EdgarCacheStore = { cache: { ...s.cache }, etags: { ...s.etags }, lastModified: { ...s.lastModified } };
|
||||
newStore.cache[key] = searchData?.filings ?? [];
|
||||
if (resp?.headers?.etag) newStore.etags[key] = resp.headers.etag;
|
||||
if (resp?.headers?.lastModified) newStore.lastModified[key] = resp.headers.lastModified;
|
||||
writeStore(newStore);
|
||||
|
||||
return {
|
||||
value: searchData?.filings ?? [],
|
||||
ttlClass: 'daily_permanent',
|
||||
|
||||
Reference in New Issue
Block a user