fix(nbstore): fix indexer cache not working (#11922)
This commit is contained in:
@@ -265,6 +265,8 @@ export class DataStruct {
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
const result = await (async () => {
|
||||
using _ = await this.measure(`query[${query.type}]`);
|
||||
if (query.type === 'match') {
|
||||
const iidx = this.invertedIndex.get(table)?.get(query.field as string);
|
||||
@@ -299,6 +301,11 @@ export class DataStruct {
|
||||
return await iidx.all(trx);
|
||||
}
|
||||
throw new Error(`Query type '${query.type}' not supported`);
|
||||
})();
|
||||
|
||||
cache.set(query, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async clear(trx: DataStructRWTransaction) {
|
||||
|
||||
Reference in New Issue
Block a user