Skip to content

Commit a5b075f

Browse files
committed
fix: 修复代码执行时调用saveNotebookContent导致 kernel shutdown 问题
1 parent 5712757 commit a5b075f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

packages/libro-jupyter/src/cell/jupyter-code-cell-view.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ export class JupyterCodeCellView extends LibroCodeCellView {
210210
}
211211
(cellModel.metadata.execution as any)['libro_execution_msg_id'] =
212212
future.msg.header.msg_id;
213-
// 触发保存
214-
this.parent.model.saveNotebookContent();
213+
cellModel.metadata = { ...cellModel.metadata };
215214

216215
// Handle iopub messages
217216
future.onIOPub = (msg: any) => {
@@ -222,8 +221,7 @@ export class JupyterCodeCellView extends LibroCodeCellView {
222221
to_execute: new Date().toISOString(),
223222
libro_execution_msg_id: future.msg.header.msg_id,
224223
} as ExecutionMeta;
225-
// 触发保存
226-
this.parent.model.saveNotebookContent();
224+
cellModel.metadata = { ...cellModel.metadata };
227225
cellModel.kernelExecuting = true;
228226
startTimeStr = msg.header.date as string;
229227
const meta = cellModel.metadata.execution as ExecutionMeta;

0 commit comments

Comments
 (0)