Merge pull request #1979 from emlys/bugfix/1978

Shut down plugin process before removing its environment
This commit is contained in:
Emily Soth 2025-05-28 17:25:36 -07:00 committed by GitHub
commit 24de3d6caa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import crypto from 'crypto';
import { getLogger } from './logger';
import { ipcMainChannels } from './ipcMainChannels';
import { settingsStore } from './settingsStore';
import { shutdownPythonProcess } from './createPythonFlaskProcess';
const logger = getLogger(__filename.split('/').slice(-1)[0]);
@ -190,6 +191,9 @@ export function setupRemovePlugin() {
async (e, pluginID) => {
logger.info('removing plugin', pluginID);
try {
// Shut down the plugin server process
const pluginPID = settingsStore.get(`plugins.${pluginID}.pid`);
await shutdownPythonProcess(pluginPID);
// Delete the plugin's conda env
const env = settingsStore.get(`plugins.${pluginID}.env`);
const micromamba = settingsStore.get('micromamba');