Skip to content

Commit

Permalink
refactor: Remove async keyword from destroy method in segments-storag…
Browse files Browse the repository at this point in the history
…e.interface.ts
  • Loading branch information
DimaDemchenko committed Aug 22, 2024
1 parent 6c5e3cd commit 7532a4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/p2p-media-loader-core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export class Core<TStream extends Stream = Stream> {
this.streams.clear();
this.mainStreamLoader?.destroy();
this.secondaryStreamLoader?.destroy();
void this.segmentStorage?.destroy();
this.segmentStorage?.destroy();
this.mainStreamLoader = undefined;
this.secondaryStreamLoader = undefined;
this.segmentStorage = undefined;
Expand Down
3 changes: 1 addition & 2 deletions packages/p2p-media-loader-core/src/segments-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ export class SegmentsMemoryStorage implements ISegmentsStorage {
: this.secondaryStreamConfig.httpDownloadTimeWindow;
}

// eslint-disable-next-line @typescript-eslint/require-await
public async destroy() {
public destroy() {
this.cache.clear();
this._isInitialized = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ export interface ISegmentsStorage {

unsubscribeFromUpdate(streamId: string, listener: () => void): void;

destroy(): Promise<void>;
destroy(): void;
}

0 comments on commit 7532a4e

Please sign in to comment.