mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@@ -115,6 +115,7 @@ class DiskCache {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async verify(directoriesList) {
|
||||
try {
|
||||
if (!useDiskCache) {
|
||||
return;
|
||||
}
|
||||
@@ -134,6 +135,9 @@ class DiskCache {
|
||||
await cache.removeItem(key);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error while verifying disk cache:', error);
|
||||
}
|
||||
}
|
||||
|
||||
dispose() {
|
||||
@@ -172,7 +176,8 @@ async function readCharacterData(inputFile, inputFormat = 'png') {
|
||||
}
|
||||
if (useDiskCache) {
|
||||
try {
|
||||
const cachedData = await diskCache.instance().then(i => i.getItem(cacheKey));
|
||||
const cache = await diskCache.instance();
|
||||
const cachedData = await cache.getItem(cacheKey);
|
||||
if (cachedData) {
|
||||
return cachedData;
|
||||
}
|
||||
@@ -185,7 +190,8 @@ async function readCharacterData(inputFile, inputFormat = 'png') {
|
||||
!isAndroid && memoryCache.set(cacheKey, result);
|
||||
if (useDiskCache) {
|
||||
try {
|
||||
await diskCache.instance().then(i => i.setItem(cacheKey, result));
|
||||
const cache = await diskCache.instance();
|
||||
await cache.setItem(cacheKey, result);
|
||||
} catch (error) {
|
||||
console.warn('Error while writing to disk cache:', error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user