Skip to content

Commit 10e569a

Browse files
committed
Only clean kernel client
1 parent ed780b9 commit 10e569a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

voila/notebook_renderer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ async def _jinja_notebook_execute(self, nb, kernel_id):
252252
# (it seems to be local to our block)
253253
nb.cells = result.cells
254254

255+
await self._cleanup_resources()
256+
255257
async def _jinja_cell_generator(self, nb, kernel_id):
256258
"""Generator that will execute a single notebook cell at a time"""
257259
nb, _ = ClearOutputPreprocessor().preprocess(
@@ -301,6 +303,11 @@ async def _jinja_cell_generator(self, nb, kernel_id):
301303
finally:
302304
yield output_cell
303305

306+
await self._cleanup_resources()
307+
308+
async def _cleanup_resources(self):
309+
await ensure_async(self.executor.kc.stop_channels())
310+
304311
async def load_notebook(self, path):
305312

306313
model = await ensure_async(self.contents_manager.get(path=path))

0 commit comments

Comments
 (0)