mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Allow plugins to specify "exit" functions
This commit is contained in:
@ -608,9 +608,12 @@ const setupTasks = async function () {
|
||||
await loadTokenizers();
|
||||
await statsEndpoint.init();
|
||||
|
||||
const cleanupPlugins = await loadPlugins();
|
||||
|
||||
const exitProcess = () => {
|
||||
statsEndpoint.onExit();
|
||||
process.exit();
|
||||
cleanupPlugins();
|
||||
};
|
||||
|
||||
// Set up event listeners for a graceful shutdown
|
||||
@ -621,7 +624,6 @@ const setupTasks = async function () {
|
||||
exitProcess();
|
||||
});
|
||||
|
||||
await loadPlugins();
|
||||
|
||||
console.log('Launching...');
|
||||
|
||||
|
Reference in New Issue
Block a user