Cap save queue

This commit is contained in:
mcrcortex
2025-04-21 16:51:33 +10:00
parent c2e95876d0
commit 3684174b67
2 changed files with 13 additions and 1 deletions

View File

@@ -50,6 +50,18 @@ public class SectionSavingService {
if (!section.inSaveQueue.getAndSet(true)) {
//Acquire the section for use
section.acquire();
//Hard limit the save count to prevent OOM
if (this.getTaskCount() > 5_000) {
while (this.getTaskCount() > 5_000) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
this.saveQueue.add(new SaveEntry(in, section));
this.threads.execute();
}

View File

@@ -1,5 +1,5 @@
{
"voxy.config.title": "Voxy config",
"voxy.config.title": "Voxy",
"voxy.config.general.enabled": "Enable Voxy",
"voxy.config.general.enabled.tooltip": "Fully enables or disables voxy",