Skip to content

Commit

Permalink
cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Jun 5, 2024
1 parent c049c93 commit 9142877
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
6 changes: 0 additions & 6 deletions packages/encrypted-blockstore/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<CarGroup>()
carReaders: Map<string, Promise<CarReader>> = new Map()
ready: Promise<void>
Expand All @@ -85,7 +84,6 @@ export class Loader implements Loadable {
writing: Promise<TransactionMeta | void> = Promise.resolve()

private getBlockCache: Map<string, AnyBlock> = new Map()
//Try to make it a set of array of strings
private seenMeta: Set<string> = new Set()

constructor(name: string, ebOpts: BlockstoreOpts) {
Expand Down Expand Up @@ -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())

Expand Down Expand Up @@ -288,16 +285,13 @@ export class Loader implements Loadable {
return { files }
}

//This needs more testing?
async updateCarLog(cids: CarGroup, fp: CarHeader, compact: boolean): Promise<void> {
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)
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/encrypted-blockstore/src/remote-wal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions packages/encrypted-blockstore/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export interface CarMakeable {
get(cid: AnyLink): Promise<AnyBlock | undefined>
}

//Changing the format of cars and compact from AnyLink[] to AnyLink[][]
export type CarHeader = {
cars: CarLog
compact: CarLog
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 9142877

Please sign in to comment.