Skip to content

Commit

Permalink
revert saveNestedDataHash cache
Browse files Browse the repository at this point in the history
  • Loading branch information
karlprieb committed Sep 20, 2024
1 parent 9a4e827 commit 089ee33
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/database/standalone-sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,6 @@ export class StandaloneSqliteDatabase
Awaited<ReturnType<StandaloneSqliteDatabase['getTransactionAttributes']>>
>;

private saveNestedDataHashCache: NodeCache;
private saveDataContentAttributesCache: NodeCache;

constructor({
Expand Down Expand Up @@ -2528,12 +2527,6 @@ export class StandaloneSqliteDatabase
// Initialize method caches
//

this.saveNestedDataHashCache = new NodeCache({
stdTTL: 60 * 7, // 7 minutes
checkperiod: 60, // 1 minute
useClones: false,
});

this.saveDataContentAttributesCache = new NodeCache({
stdTTL: 60 * 7, // 7 minutes
checkperiod: 60, // 1 minute
Expand Down Expand Up @@ -2968,17 +2961,6 @@ export class StandaloneSqliteDatabase
parentId: string;
dataOffset: number;
}): Promise<void> {
const key = `${hash}:${parentId}`;

if (this.saveNestedDataHashCache.get(key)) {
metrics.saveMethodsDuplicateCounter.inc({
method: 'saveNestedDataHash',
});

return;
}
this.saveNestedDataHashCache.set(key, true);

return this.queueWrite('data', 'saveNestedDataHash', [
{
hash,
Expand Down

0 comments on commit 089ee33

Please sign in to comment.