We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0444216 commit 35eae6cCopy full SHA for 35eae6c
src/widget.tsx
@@ -110,11 +110,17 @@ const KernelUsage = (props: {
110
'kernel'
111
>
112
) => {
113
- const kernelId = args.newValue?.id;
114
- if (kernelId) {
115
- setKernelId(kernelId);
+ const oldKernelId = args.oldValue?.id;
+ if (oldKernelId) {
+ const poll = kernelPools.get(oldKernelId);
116
+ poll?.poll.dispose();
117
+ kernelPools.delete(oldKernelId);
118
+ }
119
+ const newKernelId = args.newValue?.id;
120
+ if (newKernelId) {
121
+ setKernelId(newKernelId);
122
const path = panel?.sessionContext.session?.model.path;
- doPoll(kernelId as string, path as string);
123
+ doPoll(newKernelId as string, path as string);
124
}
125
126
);
0 commit comments