fix: cache not clear
This commit is contained in:
parent
7cdbf140a9
commit
9ca1213e50
3 changed files with 136 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import { EhrFile } from "../interfaces/ehr-fs";
|
|||
import esClient from "../elasticsearch";
|
||||
import minioClient from "../storage";
|
||||
|
||||
// for failed queue that will come later
|
||||
const cachedBuffer: Record<string, Buffer> = {};
|
||||
|
||||
export async function handler(key: string): Promise<boolean> {
|
||||
|
|
@ -22,6 +23,8 @@ export async function handler(key: string): Promise<boolean> {
|
|||
? await handleFoundRecord(rec, cachedBuffer[key])
|
||||
: await handleNotFoundRecord(pathname, cachedBuffer[key]);
|
||||
|
||||
if (result) delete cachedBuffer[key];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue