mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Adjust update intervals of some extensions
This commit is contained in:
@ -63,6 +63,24 @@ function loadSettings() {
|
||||
$('#extension_floating_default').val(extension_settings.note.default);
|
||||
}
|
||||
|
||||
let isWorkerBusy = false;
|
||||
|
||||
async function moduleWorkerWrapper() {
|
||||
// Don't touch me I'm busy...
|
||||
if (isWorkerBusy) {
|
||||
return;
|
||||
}
|
||||
|
||||
// I'm free. Let's update!
|
||||
try {
|
||||
isWorkerBusy = true;
|
||||
await moduleWorker();
|
||||
}
|
||||
finally {
|
||||
isWorkerBusy = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function moduleWorker() {
|
||||
const context = getContext();
|
||||
|
||||
@ -147,5 +165,5 @@ async function moduleWorker() {
|
||||
}
|
||||
|
||||
addExtensionsSettings();
|
||||
setInterval(moduleWorker, UPDATE_INTERVAL);
|
||||
setInterval(moduleWorkerWrapper, UPDATE_INTERVAL);
|
||||
})();
|
Reference in New Issue
Block a user