Android: Disable in-memory cache of parsed cards

b4be50d26a7d7f324cb16d6aca9d55a310440eb6

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -1Showing whitespace changes
src/endpoints/characters.js+3 -1
@@ -24,6 +24,8 @@ const defaultAvatarPath = './public/img/ai4.png';
2424
25// KV-store for parsed character data25// KV-store for parsed character data
26const characterDataCache = new Map();26const characterDataCache = new Map();
27// Some Android devices require tighter memory management
28const isAndroid = process.platform === 'android';
2729
28/**30/**
29 * Reads the character card from the specified image file.31 * Reads the character card from the specified image file.
@@ -39,7 +41,7 @@ async function readCharacterData(inputFile, inputFormat = 'png') {
39 }41 }
4042
41 const result = parse(inputFile, inputFormat);43 const result = parse(inputFile, inputFormat);
42 characterDataCache.set(cacheKey, result);44 !isAndroid && characterDataCache.set(cacheKey, result);
43 return result;45 return result;
44}46}
4547