From 914287756a5c295fbf6f8963f1c757b314950f28 Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Wed, 5 Jun 2024 08:57:12 -0700 Subject: [PATCH] cleanup comments --- packages/encrypted-blockstore/src/loader.ts | 6 ------ packages/encrypted-blockstore/src/remote-wal.ts | 1 - packages/encrypted-blockstore/src/types.ts | 2 -- 3 files changed, 9 deletions(-) diff --git a/packages/encrypted-blockstore/src/loader.ts b/packages/encrypted-blockstore/src/loader.ts index 7e164ca5..0c0edbc4 100644 --- a/packages/encrypted-blockstore/src/loader.ts +++ b/packages/encrypted-blockstore/src/loader.ts @@ -74,7 +74,6 @@ export class Loader implements Loadable { remoteWAL: RemoteWAL metaStore?: MetaStore carStore: DataStore - //Make this a 2d array - done carLog: CarLog = new Array() carReaders: Map> = new Map() ready: Promise @@ -85,7 +84,6 @@ export class Loader implements Loadable { writing: Promise = Promise.resolve() private getBlockCache: Map = new Map() - //Try to make it a set of array of strings private seenMeta: Set = new Set() constructor(name: string, ebOpts: BlockstoreOpts) { @@ -134,7 +132,6 @@ export class Loader implements Loadable { throw new Error('cannot merge while compacting') } - //We don't have to loop over meta.cars because we are converting it into a string representation if (this.seenMeta.has(meta.cars.toString())) return this.seenMeta.add(meta.cars.toString()) @@ -288,16 +285,13 @@ export class Loader implements Loadable { return { files } } - //This needs more testing? async updateCarLog(cids: CarGroup, fp: CarHeader, compact: boolean): Promise { if (compact) { const previousCompactCid = fp.compact[fp.compact.length - 1] fp.compact.map(c => c.toString()).forEach(this.seenCompacted.add, this.seenCompacted) - //Made the change here from uniqueCids to uniqueCarCids this.carLog = [...uniqueCids([...this.carLog, ...fp.cars, cids], this.seenCompacted)] void this.removeCidsForCompact(previousCompactCid[0]) } else { - //Work on this and make sure the tests pass this.carLog.unshift(cids) } } diff --git a/packages/encrypted-blockstore/src/remote-wal.ts b/packages/encrypted-blockstore/src/remote-wal.ts index 70d96e7a..b26d7d0f 100644 --- a/packages/encrypted-blockstore/src/remote-wal.ts +++ b/packages/encrypted-blockstore/src/remote-wal.ts @@ -79,7 +79,6 @@ export abstract class RemoteWAL { for (const dbMeta of noLoaderOps) { const uploadP = limit(async () => { - //Loop through the cars and call the load for each car for (const cid of dbMeta.cars) { const car = await this.loader.carStore!.load(cid).catch(() => null) if (!car) { diff --git a/packages/encrypted-blockstore/src/types.ts b/packages/encrypted-blockstore/src/types.ts index b7449591..724e4925 100644 --- a/packages/encrypted-blockstore/src/types.ts +++ b/packages/encrypted-blockstore/src/types.ts @@ -16,7 +16,6 @@ export interface CarMakeable { get(cid: AnyLink): Promise } -//Changing the format of cars and compact from AnyLink[] to AnyLink[][] export type CarHeader = { cars: CarLog compact: CarLog @@ -47,7 +46,6 @@ export type StoreOpts = { } export type CommitOpts = { noLoader?: boolean; compact?: boolean; public?: boolean } -//Changed the parameter from car:AnyLink to cars:AnyLink[] export type DbMeta = { cars: CarGroup; key: string | null } export type UploadMetaFnParams = {