shut down plugin process before removing its environment

This commit is contained in:
Emily Soth 2025-05-28 14:16:11 -07:00
parent f8d3b97d39
commit 22d8045ce5
1 changed files with 4 additions and 0 deletions

View File

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