Open MaelImhof opened 2 weeks ago
With the received answer (thank you joethei), try to implement a solution and see if it works for a normal use case (of course, if the user kills the Obsidian process, the clean up logic probably won't be executed, but check that it is executed if the user simply closes Obsidian normally).
Workspace.on('quit')
event that stops the server and basically unloads the plugin
What's the issue?
When the
Delete Jupyter checkpoints
setting is enabled, checkpoints are put all together in one folder, in the plugin's directory. This folder is supposed to be deleted when Jupyter exits.However, if the user closes Obsidian normally, the folder is never deleted.
onunload
is never called.How to reproduce?
Delete Jupyter checkpoints
is enabledWelcome.ipynb
.obsidian/plugins/jupyter/.ipynb_checkpoints
.obsidian/plugins/jupyter/.ipynb_checkpoints
What have you tried?
Found out it was because
onunload
was never called on Obsidian exit, tried to find another hook but did not have any luck yet.Additional information
Asked the question on Obsidian Forum, maybe some answer will come up there.