refactor: rename methods for clarity (#2442)
This commit is contained in:
@@ -393,7 +393,7 @@ export class HeapSnapshotManager {
|
||||
return this.#snapshots.size > 0;
|
||||
}
|
||||
|
||||
dispose(filePath: string): boolean {
|
||||
disposeSnapshot(filePath: string): boolean {
|
||||
const absolutePath = path.resolve(filePath);
|
||||
const cached = this.#snapshots.get(absolutePath);
|
||||
if (cached) {
|
||||
@@ -404,7 +404,7 @@ export class HeapSnapshotManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
disposeAll(): void {
|
||||
dispose(): void {
|
||||
for (const cached of this.#snapshots.values()) {
|
||||
cached.worker.dispose();
|
||||
}
|
||||
|
||||
+2
-2
@@ -139,7 +139,7 @@ export class McpContext implements Context {
|
||||
this.browser.off('targetdestroyed', this.#onTargetDestroyed);
|
||||
|
||||
this.#serviceWorkerConsoleCollector.dispose();
|
||||
this.#heapSnapshotManager.disposeAll();
|
||||
this.#heapSnapshotManager.dispose();
|
||||
for (const mcpPage of this.#mcpPages.values()) {
|
||||
mcpPage.dispose();
|
||||
}
|
||||
@@ -722,7 +722,7 @@ export class McpContext implements Context {
|
||||
}
|
||||
|
||||
async closeHeapSnapshot(filePath: string): Promise<boolean> {
|
||||
return this.#heapSnapshotManager.dispose(filePath);
|
||||
return this.#heapSnapshotManager.disposeSnapshot(filePath);
|
||||
}
|
||||
|
||||
hasHeapSnapshots(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user