Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kyscott18 committed Jun 11, 2024
1 parent cbe1023 commit 86451ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/core/src/_test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export async function setupDatabaseServices(
namespaceInfo: result.namespaceInfo,
db: database.indexingDb,
common: context.common,
isCacheFull: true,
})
: getRealtimeStore({
encoding: "sqlite",
Expand Down Expand Up @@ -224,6 +225,7 @@ export async function setupDatabaseServices(
namespaceInfo: result.namespaceInfo,
db: database.indexingDb,
common: context.common,
isCacheFull: true,
})
: getRealtimeStore({
encoding: "postgres",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/bin/utils/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export async function run({
namespaceInfo,
db: database.indexingDb,
common,
isCacheFull: isCheckpointEqual(zeroCheckpoint, initialCheckpoint),
});

let indexingStore: IndexingStore = {
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/indexing-store/historical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ export const getHistoricalStore = ({
namespaceInfo,
db,
common,
isCacheFull: _isCacheFull,
}: {
encoding: "sqlite" | "postgres";
schema: Schema;
namespaceInfo: NamespaceInfo;
db: HeadlessKysely<any>;
common: Common;
isCacheFull: boolean;
}): HistoricalStore => {
const maxSizeBytes = common.options.indexingCacheBytes;
const storeCache: StoreCache = {};
Expand All @@ -76,7 +78,7 @@ export const getHistoricalStore = ({
});

/** True if the cache contains the complete state of the store. */
let isCacheFull = true;
let isCacheFull = _isCacheFull;

let cacheSize = 0;
let cacheSizeBytes = 0;
Expand Down Expand Up @@ -438,6 +440,7 @@ export const getHistoricalStore = ({
schema,
skipValidate: false,
});

sanitizeRecord(record, tableName);

const bytes = getRecordSize(record);
Expand Down

0 comments on commit 86451ab

Please sign in to comment.