Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Feb 2, 2024
1 parent c1a9566 commit abaa021
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/myst-cli/src/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,6 @@ export async function build(session: ISession, files: string[], opts: BuildOpts)
await buildSite(session, opts);
}
}

session.maybeDisposeJupyterSessionManager();
}
9 changes: 9 additions & 0 deletions packages/myst-cli/src/session/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class Session implements ISession {
_shownUpgrade = false;
_latestVersion?: string;
_jupyterSessionManager: SessionManager | undefined | null = null;
_disposeJupyterSessionManager?: () => void;

get log(): Logger {
return this.$logger;
Expand Down Expand Up @@ -207,4 +208,12 @@ export class Session implements ISession {
return undefined;
}
}

maybeDisposeJupyterSessionManager() {
if (this._disposeJupyterSessionManager === undefined) {
return;
};
this._disposeJupyterSessionManager();
this._disposeJupyterSessionManager = undefined;
}
}
1 change: 1 addition & 0 deletions packages/myst-cli/src/session/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type ISession = {
loadPlugins(): Promise<MystPlugin>;
getAllWarnings(ruleId: RuleId): (BuildWarning & { file: string })[];
jupyterSessionManager(): Promise<SessionManager | undefined>;
maybeDisposeJupyterSessionManager(): void;
};

export type ISessionWithCache = ISession & {
Expand Down

0 comments on commit abaa021

Please sign in to comment.