Skip to content

Commit

Permalink
fix: IndexedDB example in demo package
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaDemchenko committed Sep 30, 2024
1 parent c43d73e commit 473017c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const DB_VERSION = 1;
const BYTES_PER_MB = 1048576;

export class IndexedDbStorage implements SegmentStorage {
private segmentsMemoryStorageLimit = 4000; // 4 GB
private currentMemoryStorageSize = 0; // current memory storage size in MB
private segmentsMemoryStorageLimit = 4096; // memory storage limit in MiB
private currentMemoryStorageSize = 0; // current memory storage size in MiB

private storageConfig?: CommonCoreConfig;
private mainStreamConfig?: StreamConfig;
Expand Down Expand Up @@ -162,7 +162,6 @@ export class IndexedDbStorage implements SegmentStorage {
// eslint-disable-next-line no-console
console.error(`Failed to store segment ${segmentId}:`, error);
throw error;
// Optionally, implement retry logic or other error recovery mechanisms
}
}

Expand Down Expand Up @@ -200,7 +199,7 @@ export class IndexedDbStorage implements SegmentStorage {
return this.cache.has(storageId);
}

getStoredSegmentIds(streamId: string) {
getStoredSegmentIds(_swarmId: string, streamId: string) {
const storedSegments: number[] = [];

for (const segment of this.cache.values()) {
Expand Down

0 comments on commit 473017c

Please sign in to comment.