mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add config.yaml value for cards cache capacity.
This commit is contained in:
@@ -680,8 +680,9 @@ export class MemoryLimitedMap {
|
||||
* @param {number} maxMemoryInBytes - The maximum allowed memory in bytes for string values.
|
||||
*/
|
||||
constructor(maxMemoryInBytes) {
|
||||
if (typeof maxMemoryInBytes !== 'number' || maxMemoryInBytes <= 0) {
|
||||
throw new Error('maxMemoryInBytes must be a positive number');
|
||||
if (typeof maxMemoryInBytes !== 'number' || maxMemoryInBytes <= 0 || isNaN(maxMemoryInBytes)) {
|
||||
console.warn('Invalid maxMemoryInBytes, using a fallback value of 1 GB.');
|
||||
maxMemoryInBytes = 1024 * 1024 * 1024; // 1 GB
|
||||
}
|
||||
this.maxMemory = maxMemoryInBytes;
|
||||
this.currentMemory = 0;
|
||||
|
Reference in New Issue
Block a user